ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Like to add bar Chart to table layout dynamically
Posted by premila on Sep-20-2010 21:33
Hi,

I like to add Bar chart dynamically to the table layout panel in c#.

Help.

Regards,
Premi

  Re: Like to add bar Chart to table layout dynamically
Posted by Peter Kwan on Sep-21-2010 01:57
Hi premila,

I think you just add the WinChartViewer to the TableLayoutPanel, just like how to add any other control to the TableLayoutPanel.

For example:

WinChartViewer viewer = new WinChartViewer();
myTableLayoutPanel.Controls.Add(viewer);

.... now create a chart and put it in the WinChartViewer as usual ....

Hope this can help.

Regards
Peter Kwan

  Re: Like to add bar Chart to table layout dynamically
Posted by premila on Sep-21-2010 18:32
Hi Peter,

Thanks for the reply.

One more question,

How to set the maximum y value. This max value will be hard coded. when i draw graph, the graph length should get adjusted as per my new value.

Eg : Max y value is 70.

The graph should be drawn for 10.

Isthis possible.

Regards,
Premi

  Re: Like to add bar Chart to table layout dynamically
Posted by Peter Kwan on Sep-22-2010 03:46
Hi premila,

You may use Axis.setLinearScale and Axis.setRounding. For example:

c.yAxis().setLinearScale(Chart.NoValue, 70);
c.yAxis().setRounding(true, false);

Hope this can help.

Regards
Peter Kwan