AreaSeries problem with high YAxis AxisCrossingValue

4 posts, 0 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 05 Sep 2013 Link to this post

    Hi,

    AreaSeries has a weird behavior when I set high YAxis AxisCrossingValue. In my case I set YAxis AxisCrossingValue=-2000000 to show XAxis DataLabels at the bottom. It seems AreaSeries takes AxisCrossingValue as base to construct the area, so chart becomes weired. Please refer to attached image for clarification.

    First chart has the default values, DataLabels are just below 0 and area is constructed as expected.
    Second chart has DataLabels at the bottom (which is I need to do) with setting YAxis AxisCrossingValue=-2000000 property. But area becomes weird, because it is constructed based on AxisCrossingValue not 0 (zero).
    Last chart is what I would like to achieve.

    Any help on this problem would be greatly appreciated.
  2. Stamo Gochev
    Admin
    Stamo Gochev avatar
    157 posts

    Posted 10 Sep 2013 Link to this post

    Hello Barbaros,

    Could you provide me with a short explanation about why do you need to set such a very big number for the AxisCrossingValue? Could you use a lower number instead?

    Judging from your screenshot, all of the series items' values are in the range [-30 000, +5000], so an AxisCrossingValue within that range seems more reasonable. Setting a high AxisCrossingValue forces the RadHtmlChart to adjust its elements automatically, so the behavior is somewhat expected.

    Regards,
    Stamo Gochev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 11 Sep 2013 Link to this post

    Hi,

    It doesn't matter how big the number is. Anything other than zero causes this problem. I have attached a sample project which you can test for this. First chart is default and the area is as expected. Second chart has AxisCrossingValue=-2000000 property which I use. Third chart has AxisCrossingValue=-2788 which is as you mentioned a lower value. Fourth chart (actually it an image) is what I would like to have. And the fifth chart has AxisCrossingValue=-2788 which you suggested and showing what it should be with red line are. For example January area should begin from 0 to -2788 and so on.

    Or we can think totally different. Here is my question; I think we agree that the first chart is as expected. So how can I show month names at the bottom of chart with no change for the chart area (which is ok)(like fourth -gray- chart) ?

    sample project can be downloaded here
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 16 Sep 2013 Link to this post

    Hi Barbaros,

    The ability to change XAxis labels position has already been logged in our feedback portal here, so that you can monitor, comment and vote on it. As more and more people vote on particular item its probability for implementation raises.

    For the time being you can use the TextStyle property of the RadHtmlChart, in order to set higher margin for the XAxis labels. For example:

    ASPX:
    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600px" Height="400px">
        <PlotArea>
            <Series>
                <telerik:ColumnSeries>
                    <SeriesItems>
                        <telerik:CategorySeriesItem Y="20" />
                        <telerik:CategorySeriesItem Y="-20" />
                        <telerik:CategorySeriesItem Y="-20" />
                    </SeriesItems>
                </telerik:ColumnSeries>
            </Series>
            <XAxis>
                <LabelsAppearance>
                    <TextStyle Margin="135px" />
                </LabelsAppearance>
                <Items>
                    <telerik:AxisItem LabelText="item1" />
                    <telerik:AxisItem LabelText="item2" />
                    <telerik:AxisItem LabelText="item3" />
                </Items>
            </XAxis>
        </PlotArea>
    </telerik:RadHtmlChart>

    Note, however, that labels margin and chart's plotarea height are inversely proportional - the higher the margin is the lower the chart's plotarea height will be. This resizing is needed, in order for the chart's main dimensions to be kept.


    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top