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

AreaSeries problem with high YAxis AxisCrossingValue

3 Answers 78 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 05 Sep 2013, 12:32 PM
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.

3 Answers, 1 is accepted

Sort by
0
Stamo Gochev
Telerik team
answered on 10 Sep 2013, 06:12 AM
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.
0
Barbaros Saglamtimur
Top achievements
Rank 1
answered on 11 Sep 2013, 07:30 AM
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
0
Danail Vasilev
Telerik team
answered on 16 Sep 2013, 08:55 AM
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.
Tags
Chart (HTML5)
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Stamo Gochev
Telerik team
Barbaros Saglamtimur
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or