Hi,
I have a column chart and I would like to display information about the column pointed by the mouse. I dont want to use the tooltip, its position changes all the time and its disturbing. I want to put a TextBlock in my window that will act as a tooltip but the position will remain.
I would also like to change the look of the column when the cursor is over it. Ex : change the DataPointColor property or show the marker only when the mouse is over the column.
I cannot find the MousHover event.
(you can see an example of what I would like to do here)
http://ca.finance.yahoo.com/charts?s=%5EGSPTSE#chart6:symbol=^gsptse;range=3m;indicator=volume;charttype=line;crosshair=on;ohlcvalues=0;logscale=on;source=undefined
Thanks
Karine
About your second require to change the color of the DataPoint you can try the following :
Brush defaultBrush;
public Window1(){ InitializeComponent(); Loaded += new RoutedEventHandler(Window1_Loaded); }
void Window1_Loaded(object sender, RoutedEventArgs e) { EventManager.RegisterClassHandler(typeof(DataPoint),DataPoint.MouseEnterEvent,new MouseEventHandler(OnDataPointMouseEnter)); EventManager.RegisterClassHandler(typeof(DataPoint), DataPoint.MouseLeaveEvent, new MouseEventHandler(OnDataPointMouseLeave)); } void OnDataPointMouseEnter(object sender, MouseEventArgs e) { DataPoint currentPoint=e.Source as DataPoint; defaultBrush = currentPoint.Fill; textBlock.Text = currentPoint.Value.ToString(); currentPoint.Fill = Brushes.Red; } void OnDataPointMouseLeave(object sender, MouseEventArgs e) { DataPoint currentPoint = e.Source as DataPoint; textBlock.Text = ""; currentPoint.Fill = defaultBrush; }
Hope this helps
Best Regards
Vlad Zagorski
Developer Support Team
hi, i'm currently looking into the same feature, but it seems that if the DataPointColor set to Auto, the currentPoint.Fill will return null.
what i'm trying to do is: to get the color from the data point and use that to change the color of the textblock font color.
http://www.google.com/finance?q=INDEXDJX:.DJI,INDEXSP:.INX,INDEXNASDAQ:.IXIC
anyway to achieve this?
Thanks.