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

三世轮回 提交于 2019-12-12 05:07:38

问题


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.


回答1:


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;


来源:https://stackoverflow.com/questions/14335790/how-to-use-uielement-createlabels-method-in-numericlabelproviderbase-class-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!