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

Different styles for Bar chart

3 Answers 113 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 05 Jul 2011, 11:31 AM
Hi,

We are using a telerik radchart control for showing Actuals,Budget and Forecast scenario data. As of now we are showing the same colors for the series and because of that it would be difficult for us to identify the data. Please see screen shot.

Is there any way to change the style of Bar Chart.By deafult it shows Bar Chart with filled color. Can we show Bar chart wih different style in order to identify the data even if the chart color is same.

NOTE: As per our requirement we can not change the colour of data series.

Regards,
Gaurav

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 06 Jul 2011, 11:35 AM
Hi Gaurav,

The shade you see over the bars is a mask overlay. It can be changed to achieve three different styles for bars which have the same fill. Can you please send us a picture of the desired look and we will send you a solution which will be appropriate for you scenario?

Kind regards,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Gaurav
Top achievements
Rank 1
answered on 06 Jul 2011, 06:43 PM
Hi Sia,

Please see attached sceenshot where both the Bars has same color but with some different style  so that we can easily identify the bar chart even if the series has same colors. On the similiar line can we have different styles for Bar chart  ? (like Bar chart with Solid Fill, Bar Chart with cross lines etc)  

Regards,
Gaurav Shah
0
Sia
Telerik team
answered on 11 Jul 2011, 06:40 PM
Hello Gaurav,

Please try to use the following custom item style for one of the bar series definitions in your project:

<LinearGradientBrush x:Key="BarMaskBrush" EndPoint="0.5,0" StartPoint="0.5,1">
    <GradientStop Color="#FF21CBBE"  />
    <GradientStop Color="Transparent" Offset="1" />
</LinearGradientBrush>

<Style x:Key="CustomBar"  TargetType="telerik:Bar">
    <Setter Property="Template" >
        <Setter.Value>
            <ControlTemplate TargetType="telerik:Bar">
                <Canvas Opacity="0"  x:Name="PART_MainContainer">
                    <Rectangle x:Name="PART_DefiningGeometry"                                   
                        Height="{TemplateBinding ItemActualHeight}"
                        Width="{TemplateBinding ItemActualWidth}"
                        Style="{TemplateBinding ItemStyle}" />
                    <Rectangle Height="{TemplateBinding ItemActualHeight}"
                        Width="{TemplateBinding ItemActualWidth}"
                        Fill="{StaticResource BarMaskBrush}" />
                    <Canvas.RenderTransform>
                        <ScaleTransform x:Name="PART_AnimationTransform" ScaleY="0" />
                    </Canvas.RenderTransform>
                </Canvas>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

I hope this helps.

Greetings,
Sia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Chart
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Sia
Telerik team
Gaurav
Top achievements
Rank 1
Share this question
or