hello,
my question is how can I create legend in a form of spectrum (with colors and numbers, same as the attached file).
in the attached file please ignore the chart itself and data presentation, i'm only interested in the legend presentation, its color spectrum and numbers.
can you please show me, in code (wpf+ telerik) or references how to achieve this kind of legend?
thank you so match
5 Answers, 1 is accepted
0
Hi Stav,
There is no attachment. Can you please reattach and post it again? Also, note that the forum allows you to upload only images.
Additionally, you can check the RadLegend help documentation. The RadLegend control is used to display the RadChartView legend items.
Regards,
Martin
Telerik by Progress
There is no attachment. Can you please reattach and post it again? Also, note that the forum allows you to upload only images.
Additionally, you can check the RadLegend help documentation. The RadLegend control is used to display the RadChartView legend items.
Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Hila
Top achievements
Rank 1
answered on 12 Jul 2016, 12:57 PM
attachment
0
Hila
Top achievements
Rank 1
answered on 12 Jul 2016, 01:00 PM
now its ok.sorry
0
Hello Stav,
RadChartView and RadLegend don't support such visualization out of the box. However, you can achieve it with custom code. Depending on the spectrum visualization that you want to achieve I can suggest you couple approaches.
Regards,
Martin
Telerik by Progress
RadChartView and RadLegend don't support such visualization out of the box. However, you can achieve it with custom code. Depending on the spectrum visualization that you want to achieve I can suggest you couple approaches.
- Define a Border next to the chart and set its Background to a LinearGradientBrush. Then map the values range that you want to display to the pixels height of the Border. And calculate the gradient of the brush. This will give you smooth transitions between the colors.
- Another approach is to use RadLegend with custom ItemTemplate. Each legend item will contain a rectangle with a color. For example the values between 5 and 10 will have a legend item with color red. The values between 10 and 15 will have another item with color orange. Values between 15 and 20, color yellow and etc. You can find this approach in the attached project.
Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Hila
Top achievements
Rank 1
answered on 17 Jul 2016, 08:16 AM
thank you for your detailed response it was helpful