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

RadChart with AutoRange cutting off Y-Axis

3 Answers 173 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kirill
Top achievements
Rank 1
Kirill asked on 18 May 2011, 12:55 PM
This problem is very strange and I'm starting to think it has to do with the control itself because I was able to hack a solution by doing the following:

ChartArea chartArea = xxx;
chartArea.AxisY.AutoRange = true;
double min = chartArea.AxisY.ActualMinValue;
double max = chartArea.AxisY.ActualMaxValue;
double step = chartArea.AxisY.ActualStep;
chartArea.AxisY.AutoRange = false;
chartArea.AxisY.AddRange(min, max, step);


The problem is that sometimes a stacked bar graph chart cuts off the top of all the bars. In my case I have it in a tile, and it displays  fine when it is small, but when I scale it up, even with the same proportions, it gets cut off. The nature of my solution makes me think that it's just a bug with the auto range feature of the chart.

At this point, I'm not totally sure what about the specific data I have is causing the problem, but I suspect it has to do with a large disparity between the shortest bar, and the longest. (Not series, but overall bar, as defined by group).

The problem seems to occur as I increase the height of the chartArea. It seems to stretch the bars out more than the chart's height grows. (as unintuitive as that sounds). The chart itself is not getting cut off. It is fitting perfectly fine inside its container; it is the bars themselves that are the problem.

I'm using the 419 build.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 20 May 2011, 08:41 AM
Hi Kirill,

Unfortunately we were unable to reproduce the problem you are experiencing. Can you please open a support ticket and send us a sample project that reproduces the mentioned problem? Also some sample data will be very useful for us. This way we will be able to investigate the problem in details and advice you further.

Regards,
Yavor Ivanov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Joel
Top achievements
Rank 1
answered on 01 Sep 2011, 07:56 PM
I think I'm seeing an issue like this.  My situation is a bit strange because I'm using a chart to display the Y-axis for another chart hosted inside of a TimeBar.  By manually copying over the Min/Max/Step values, I get an exact duplicate of the axis for my chart, but sometimes it's displayed with the top and bottom cut off.

I've attached a screen shot.

Here is my chart:
<telerik:RadChart x:Name="rcScaleHeader" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Right" SizeChanged="rcScaleHeader_SizeChanged">
    <telerik:RadChart.DefaultView>
        <telerik:ChartDefaultView>
            <telerik:ChartDefaultView.ChartArea>
                <telerik:ChartArea>
                    <telerik:ChartArea.AxisX>
                        <telerik:AxisX IsDateTime="True" DefaultLabelFormat="#VAL{HH:mm:ss}" AutoRange="False" Visibility="Collapsed"/>
                    </telerik:ChartArea.AxisX>
                    <telerik:ChartArea.AxisY>
                        <telerik:AxisY AutoRange="False" StripLinesVisibility="Collapsed" MinValue="0" MaxValue="50" Step="5" />
                    </telerik:ChartArea.AxisY>
                </telerik:ChartArea>
            </telerik:ChartDefaultView.ChartArea>
 
            <telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartLegend Visibility="Collapsed"/>
            </telerik:ChartDefaultView.ChartLegend>
            <telerik:ChartDefaultView.ChartTitle>
                <telerik:ChartTitle Visibility="Collapsed"/>
            </telerik:ChartDefaultView.ChartTitle>
        </telerik:ChartDefaultView>
    </telerik:RadChart.DefaultView>
</telerik:RadChart>

It isn't always clipped, but I'd say it's clipped at least 60% of the time.  I feel like there's a padding value hiding somewhere, but I haven't been able to find it.

The blue border around the chart shows the entire area for the chart.  It's very narrow, but that's by design.  The issue seems to go away if I tell the chart to be 200 wide, but use the border to clip it to a smaller width (60, in my case).

I realize this may not be a targeted use case, but it seems like there's something not quite right with the chart when it's really narrow.  Can you suggest a better fix?
0
Yavor
Telerik team
answered on 07 Sep 2011, 09:24 AM
Hi Joel,

We created a small demo application using your code and tested it in our labs. Unfortunately we couldn't make the axis appear as it does in the image you shared. I am attaching this sample application so that you can try it in your environment. Perhaps there is something we are missing that makes the axis get clipped.

Greetings,
Yavor Ivanov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Chart
Asked by
Kirill
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Joel
Top achievements
Rank 1
Share this question
or