We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change orientation of RangeColumnSeries Chart?

I'm trying to create a chart which shows a category name spanning over a period of time, and I'm using a RangeColumnSeries chart to do that. Something like this:
http://6.anychart.com/products/anychart/docs/users-guide/img/Samples/sample-range-bar-chart-y-datetime-axis.png

It works great except that I would like to flip the Primary and Secondary Axis, such that the category name is the Y axis, and my high and low values represent a date range for the X axis. For some charts I can swap the CategoryAxis and NumericalAxis, but not apparently with the RangeColumnSeries. Any ideas?

                                <chart:SfChart HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                   
                                    <chart:SfChart.PrimaryAxis>
                                       
                                        <chart:CategoryAxis ShowMajorGridLines="False">
                                            <chart:CategoryAxis>
                                            </chart:CategoryAxis>
                                        </chart:CategoryAxis>
                                       
                                    </chart:SfChart.PrimaryAxis>
                                    <chart:SfChart.SecondaryAxis>
                                       
                                        <chart:NumericalAxis ShowMajorGridLines="False" ShowMinorGridLines="False">
                                            <chart:NumericalAxis>
                                                <chart:NumericalAxis.LabelStyle>
                                                    <chart:ChartAxisLabelStyle />
                                                </chart:NumericalAxis.LabelStyle>
                                            </chart:NumericalAxis>
                                        </chart:NumericalAxis>
                                       
                                    </chart:SfChart.SecondaryAxis>
                                    <chart:SfChart.Legend>
                                        <chart:ChartLegend DockPosition="Bottom" >
                                            <chart:ChartLegend.LabelStyle>
                                                <chart:ChartLegendLabelStyle Font="Bold,10" />
                                            </chart:ChartLegend.LabelStyle>
                                        </chart:ChartLegend>
                                    </chart:SfChart.Legend>
                                    <chart:SfChart.Series>
                                        <chart:RangeColumnSeries ItemsSource ="{Binding Charts}"
                                                                 XBindingPath="Name"
                                                                 High="EndDayHigh"
                                                                 Low="StartDayLow">
                                            <!--<chart:RangeColumnSeries.DataMarker>
                                                <chart:ChartDataMarker />
                                            </chart:RangeColumnSeries.DataMarker>-->
                                            <chart:RangeColumnSeries.ColorModel>
                                                <chart:ChartColorModel Palette="Custom" CustomBrushes="{StaticResource Colors}"/>
                                            </chart:RangeColumnSeries.ColorModel>
                                        </chart:RangeColumnSeries>
                                    </chart:SfChart.Series>
                                </chart:SfChart>

3 Replies

MK Muneesh Kumar G Syncfusion Team September 7, 2017 11:42 AM UTC

Hi Mark, 
  
Thanks for using Syncfusion Products. 
We would like to inform you that we can able to swap XAxis and YAxis for all the series by setting IsTransposed property as true as per the below code snippet. 
  
Code Snippet [XAML]: 
  
  
<chart:RangeColumnSeries x:Name="series1" Label="Series1" 
IsTransposed="True"> 
  
  
We have prepared a sample based on this and you can find the sample under the following location: 
Please let us know if you have any queries. 
Regards, 
Muneesh Kumar G. 




MA Mark September 7, 2017 03:12 PM UTC

That's perfect!

Thank you

Mark



PS Parthiban Sundaram Syncfusion Team September 8, 2017 09:12 AM UTC

Hi Mark,

Thanks for the update. We are glad that the given solution has helped to achieve your requirement. Please let us know for your further assistance.

Regards,
Parthiban S

Loader.
Up arrow icon