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

Message ListMessage List     Post MessagePost Message

  Updating the Chart legend on Mouse Click
Posted by Yogesh Iparkar on Jul-08-2011 15:33
Hi Peter,

how do i update the chart legend on mouse click.

Is there any set statement.

  Re: Updating the Chart legend on Mouse Click
Posted by Peter Kwan on Jul-09-2011 01:40
Hi Yogesh,

To update or change anything in the chart, you would need to recreate the chart. The chart object cannot be modified after being displayed.

Regards
Peter Kwan

  Re: Updating the Chart legend on Mouse Click
Posted by Yogesh Iparkar on Jul-09-2011 13:50
ok thanks,

My next question is how do i update the legend with my values.

If i want to display a string in legend like "Change : 10" on every mouse click with redrawing
the chart.

How i can do that?

I searched the forum but dint find the solution.

somebody must have had this question. If you can direct me to the right link it will be very
helpful.

  Re: Updating the Chart legend on Mouse Click
Posted by Yogesh Iparkar on Jul-09-2011 13:54
And one very important information : I am using C#.Net 2008 for displaying chart.

  Re: Updating the Chart legend on Mouse Click
Posted by Peter Kwan on Jul-11-2011 02:57
Hi Yogesh,

By "update the legend", I assume you mean you want to add some text in the legend box.

In your charting code, you may have something like:

if (processing_mouse_click)
    c.getLegend().addKey("Change: 10", 0xff0000);

The above will add the text "Change: 10" in the legend box if processing_mouse_click is true. So in your mouse click handler, you can set processing_mouse_click to true, redraw the chart, then set processing_mouse_click back to false.

Hope this can help.

Regards
Peter Kwan