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

Formatting bar chart

5 Answers 189 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 30 Jan 2019, 07:09 PM

Here's my code. I have attached a screenshot of the resulting chart. I have a few questions...

1. How do I remove the horizontal marks on the left axis?

2. How do I remove the spacing between each bar?

3. How do I make it always show '0' on the horizontal axis?

<telerikChart:RadCartesianChart PaletteName="Light" SelectionPaletteName="LightSelected" Margin="10,10,10,10" Grid.Row="0" x:Name="hoursChart" BackgroundColor="White">
                <telerikChart:RadCartesianChart.HorizontalAxis>
                    <telerikChart:NumericalAxis MajorStep="10" LineColor="White" MajorTickBackgroundColor="White"  />
                </telerikChart:RadCartesianChart.HorizontalAxis>
                <telerikChart:RadCartesianChart.VerticalAxis>
                    <telerikChart:CategoricalAxis  GapLength="0" LineColor="Transparent"  MajorTickThickness="1" PlotMode="BetweenTicks" LabelFitMode="MultiLine"  ShowLabels="False" MajorTickBackgroundColor="#A9A9A9" />
                </telerikChart:RadCartesianChart.VerticalAxis>
                <telerikChart:RadCartesianChart.Series>
                    <telerikChart:BarSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding SeriesData}" CombineMode="Stack" />
                    <telerikChart:BarSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding SecondSeriesData}" CombineMode="Stack" />
                    <telerikChart:BarSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding ThirdSeriesData}" CombineMode="Stack" />
                    <telerikChart:BarSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding FourthSeriesData}" CombineMode="Stack" />
                </telerikChart:RadCartesianChart.Series>
                <telerikChart:RadCartesianChart.Palette>
                    <telerikChart:ChartPalette >
                        <telerikChart:ChartPalette.Entries>
                            <telerikChart:PaletteEntry  FillColor="#d12f23" StrokeColor="Transparent" />
                            <telerikChart:PaletteEntry FillColor="#eebc2c" StrokeColor="Transparent" />
                            <telerikChart:PaletteEntry FillColor="#b1a58f" StrokeColor="Transparent" />
                            <telerikChart:PaletteEntry FillColor="#86c4cd" StrokeColor="Transparent" />
                        </telerikChart:ChartPalette.Entries>
                    </telerikChart:ChartPalette>
                </telerikChart:RadCartesianChart.Palette>
            </telerikChart:RadCartesianChart>

5 Answers, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 30 Jan 2019, 07:13 PM

I have fixed number one with the following on the CategoricalAxis...

MajorTickBackgroundColor="Transparent"

 

 

0
Ian
Top achievements
Rank 1
answered on 30 Jan 2019, 07:46 PM

Another question...

4) How can I change the font family of the numbers on the horizontal axis?

0
Ian
Top achievements
Rank 1
answered on 30 Jan 2019, 07:54 PM

I have fixed number by setting the stroke color on the bars to the same as the fill color.

So only question 3 & 4 remaining. :)

0
Ian
Top achievements
Rank 1
answered on 31 Jan 2019, 06:29 PM

aha... I made the axis always show zero by rounding the maximum up to the nearest major step and rounding the minimum down to the nearest major step.

So, now I just need to know how to change the font of the tick numbers.

0
Didi
Telerik team
answered on 01 Feb 2019, 03:26 PM
Hello Ian,

I am glad you have managed to solve questions 1, 2 and 3.

Regarding to the 4th question: How can I change the font family of the numbers on the horizontal axis? I have tried different scenarios using a custom renderer but I could not find any suitable solution for this.

Let me know if you have any additional questions or concerns.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Ian
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Didi
Telerik team
Share this question
or