Adding an element to a PlotModel

Oystein Bjorke 6 лет назад 0
This discussion was imported from CodePlex

bsguedes wrote at 2013-03-05 15:17:


Is it possible to add custom elements to a PlotModel?
For instance, I would like to build a second Legend to a plot (it is not an annotation, since it should be fixed in the top corner, when I zoom or move the plot). This second legend could be a StackPanel, or a OxyRect, or a Grid maybe.

Thank you.

objo wrote at 2013-03-13 21:29:

It should be possible to use an annotation for the second legend. Derive from Annotation and override the Render method. You don't need to transform the rendered content by the axes, just use the PlotModel.PlotArea property to find the coordinates. Note that annotations are not part of the measure/arrange methods for the 'plot area', so you need to set the plot margins manually if you want to place the second legend outside the plot area.

wolf9s wrote at 2014-07-26 12:57:

But, in WPF, how i do [Derive from Annotation and override the Render method]?

Сервис поддержки клиентов работает на платформе UserEcho