Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to create a movable legend at runtime

$
0
0

This example shows how to provide the capability for end-users to move a chart's legend at runtime.


Question Comments

Added By: Dimitar Tomov Dimitrov at: 6/12/2014 6:50:57 AM    

Hi DevExpress team,

I would like to point you to a small issue with this example and share a solution.
However the example works as expected, it breaks down the scrolling by mouse behavior of the chart. The cause is that the mouse is captured in the chart_MouseLeftButtonDown event handler without checking if we are over the legend or not.

The solution is very simple - Just check the state of the isDragging variable before capturing the mouse. If isDragging is true, than we are over the legend and we can capture the mouse. Otherwise we shouldn't capture the mouse in order to allow the chart to be scrolled by mouse.

Regards,

Dimitar Dimitrov


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>