Getting rid of axis lines and styling charts

Hello,

I will include a file with before pictures (what I have now, the orange charts) and after pictures (what I am trying to achieve, the blue c).

Picture 1:

  1. I would like to get rid of the major axis lines for the x and y axis.
  2. How to only keep x axis values at the bottom but get rid of y axis values on the left. As seen in the picture, I want the 0, 50, and 100 to disappear but I would like the see the dates at the bottom
  3. Keep the chart the same width but make the columns skinnier
  4. Add lines in between the columns
  5. Make the 90% column data marker appear above the chart. Once it gets to high it puts the data marker inside the column. Is there a way to keep this on the top?
Picture 2:
  1. Get rid of major x and y axis lines that border the chart (same as picture 1
  2. Only keep y axis strings but not x axis numbers

I have worked with the below documentation and have had no luck:

Thank you,

-David

Attachment: Syncfusion_chart_screenshots_5316f0a2.zip

1 Reply

DD Devakumar Dhanapoosanam Syncfusion Team May 26, 2022 12:41 PM UTC

Hi David Bauer,


Query 1: I would like to get rid of the major axis lines for the x and y axis.


We can show or hide the axis MajorGridLines using the ShowMajorGridLines property of axis as per in the below code example.


<chart:NumericalAxis ShowMajorGridLines="False"/>


https://help.syncfusion.com/xamarin/charts/axis#grid-lines-customization


Query 2: How to only keep x axis values at the bottom but get rid of y axis values on the left.

We can hide the y axis values by setting axis IsVisible property as false as per in below code example.


<chart:NumericalAxis IsVisible="False"/>


Query 3: Keep the chart the same width but make the columns skinnier


Currently we don’t have support for fixed column width instead of that we can adjust the column width using Width property of Column series. 


Already we have added this requirement to our feature request list, and you can track the status of this feature from below link. Please cast your vote to make it count.


https://www.syncfusion.com/feedback/13060/fixed-column-width-support-for-segment-in-columnseries


Query 4: Add lines in between the columns


We can show the grid lines between columns for DateTimeAxis or NumericalAxis using the ShowMinorGridLines and MinorTicksPerInterval property of axis as per in the below code example.

<chart:DateTimeAxis ShowMajorGridLines="False" ShowMinorGridLines="True" MinorTicksPerInterval="1">


And for CategoryAxis we can position by setting LabelPlacement to BetweenTicks.
https://help.syncfusion.com/xamarin/charts/axis#placing-labels-between-ticks


Query 5: Make the 90% column data marker appear above the chart.


We can position the datamarker label on top of the column by using the DataMarkerPosition and LabelPosition as per in the below code example

<chart:ColumnSeries ItemsSource="{Binding ColumnData}"

                    XBindingPath="Date" YBindingPath="YValue"

                    Width="0.5" CornerRadius="10,10,10,10"

                    DataMarkerPosition="Top">

    <chart:ColumnSeries.DataMarker>

        <chart:ChartDataMarker>

            <chart:ChartDataMarker.LabelStyle>

                <chart:DataMarkerLabelStyle LabelFormat="#'%'" BackgroundColor="Transparent"

                                LabelPosition="Outer"/>

            </chart:ChartDataMarker.LabelStyle>

        </chart:ChartDataMarker>

    </chart:ColumnSeries.DataMarker>

</chart:ColumnSeries>


https://help.syncfusion.com/xamarin/charts/datamarker#label-position

https://help.syncfusion.com/xamarin/charts/datamarker#datamarker-position


Query 6: Get rid of major x and y axis lines that border the chart


We can customize the chart Axis line and ticks using the AxisLineStyle, MajorTickStyle and MinorTickStyle properties.

<chart:DateTimeAxis.AxisLineStyle>

    <chart:ChartLineStyle StrokeWidth="0"/>

</chart:DateTimeAxis.AxisLineStyle>

<chart:DateTimeAxis.MajorTickStyle>

    <chart:ChartAxisTickStyle StrokeColor="Transparent"/>

</chart:DateTimeAxis.MajorTickStyle>

<chart:DateTimeAxis.MinorTickStyle>

    <chart:ChartAxisTickStyle StrokeColor="Transparent"/>

</chart:DateTimeAxis.MinorTickStyle>


https://help.syncfusion.com/xamarin/charts/axis#tick-lines-customization

https://help.syncfusion.com/xamarin/charts/axis#axis-line-customization


Query 7: Only keep y axis strings but not x axis numbers.

<chart:SfChart.SecondaryAxis >

    <chart:NumericalAxis IsVisible="False"/>

</chart:SfChart.SecondaryAxis>


Output:

Chart, bar chart

Description automatically generated

Please find the sample from the attachment below and let us know if you need any further assistance on this.


Regards,

Devakumar D


Attachment: SF_175258_714e463a.zip

Loader.
Up arrow icon