This is a migrated thread and some comments may be shown as answers.

spectrum in legend

5 Answers 90 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Hila
Top achievements
Rank 1
Hila asked on 11 Jul 2016, 11:07 AM

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

Sort by
0
Martin Ivanov
Telerik team
answered on 12 Jul 2016, 07:59 AM
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
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
Martin Ivanov
Telerik team
answered on 13 Jul 2016, 12:20 PM
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.
  • 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
Tags
ChartView
Asked by
Hila
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Hila
Top achievements
Rank 1
Share this question
or