Search code examples
c#.netdata-visualizationzedgraphscatter-plot

2D Scatter plot with arrows instead of "dots"


I want to make a 2D scatter plot with following requirements;

  • The "dots" should not be dots but instead arrows pointing either upwards or downwards depending on the data it represents.
  • It should be possible to specify what values to show on the axis.
  • The user should be able to zoom and pan on the graph.
  • I want to be able to specify what color each arrow should have.
  • The arrows should be clickable (i.e. I need some way to register a click event and decide which arrow was clicked).

I have tried to accomplish this using ZedGraph but I find it hard to get how I want, especially with the first requirement.

Is there a free charting library that would allow me to do this relatively easy in WinForms? Or, any general tips on how to accomplish the first requirement using ZedGraph?


Solution

  • I have now learned that all requirements can be accomplished using ZedGraph.

    The "dots" should not be dots but instead arrows pointing either upwards or downwards depending on the data it represents.

    The cleanest solution is to use LineItem and do custom symbol type just like in this post Customize symbol type of a ZedGraph LineItem .

    It should be possible to specify what values to show on the axis.

    An easy solution to this is to use TextLabels and manually place them where you want them.

    The user should be able to zoom and pan on the graph.

    Functionality built into ZedGraph.

    I want to be able to specify what color each arrow should have.

    One can create multiple LineItems for each color, this requires that the line itself is not visible though.

    The arrows should be clickable (i.e. I need some way to register a click event and decide which arrow was clicked).

    Easily made using the Click event and FindNearestPoint method.