Search code examples
wpfchartswpf-controlsuielementdynamic-data-display

How to use UIElement[] CreateLabels method in NumericLabelProviderBase class to insert label or text in a point inside plotter


I'm tring to override CreateLabels to insert labels or text in specific points in plotter chart but I need a help in: 1. what does the parameter (ITicksInfo<double> ticksInfo) mean and what should I send to it 2. how to use the return value to add labels to already defined Axis like _stringaxis.LabelProvider

or if there is simpler way to add text in a point please tell,

Many thanks.


Solution

  • Just found the easiest way to add a nice label inside the chart.

    CenteredTextMarker label = new CenteredTextMarker();
            label.Text = text;
    //just dawing a line with one dot tall in the same position you want the label to be 
    
    plotter.AddLineGraph(compositeDataSource1, 
                                     dptLine,
                                     label,
                                     new PenDescription(ComponentName));
    

    and I'm Hiding the legend and build a customized one my self by doing

    plotter.LegendVisible = false;