|
c# MVC ViewportcontroldemoController - Addidng ScatterLayer with clicking event |
Posted by sam on Jul-24-2018 16:45 |
|
Hi,
Could you please assist, I have added the below in
private void drawChart(RazorChartViewer viewer)
{
////////////////////////////////////////////////////////////////////////////
ScatterLayer ScatterLayer_Notes = m_XYChart_Ctg.addScatterLayer(null, dblDataSeries_NotesY.ToArray(), "Notes", Chart.TriangleShape, 10, Chart.CColor(Color.Black));
ScatterLayer_Notes.setXData(dtmTimeStamps.ToArray());
ScatterLayer_Notes.addExtraField(strDataSeries_NotesText.ToArray());
////////////////////////////////////////////////////////////////////////////
I am able to view the triangles when the chart is loaded,and would like to achieve the following :
1.) Tool tip on mouse over to show strDataSeries_NotesText
2.) to pop-up the strDataSeries_NotesText and dtmTimeStamps of the clicked triangle
Thanks
Sam |
Re: c# MVC ViewportcontroldemoController - Addidng ScatterLayer with clicking event |
Posted by Peter Kwan on Jul-25-2018 00:59 |
|
Hi sam,
The XY Zooming and Scrolling (XyzoomscrollController.cs) is a zoomable and scrollable example with a scatter layer and pop-up tooltips. Basically, you just need to add an image map to the chart. The Javascript Clickable Chart (JsclickController.cs) demonstrate how you can add mouse event handlers to the image map.
For your case, assuming your code is based on "ViewportcontroldemoController.cs", it is like:
viewer.ImageMap = ScatterLayer_Notes.getHTMLImageMap("", "", "title='{field0}' onclick='alert("{field0}: " + "{x|yyyy-mm-dd}")'");
The above code should be add after the "viewer.Image = c.makeWebImage(Chart.PNG);" line.
Regards
Peter Kwan |
|