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
close icon

secondary Y axis labels

Hi, Please help me. I have chart with secondary Y axis, in chart i have two series with primary Y axis and one series with secondary y axis series with secondary y axis has only positive values (>= 0), i set range.min = 0, range.interval = max_value / 5, range.max = 2* max_value and RangeType = ChartAxisRangeType.Set. and when I show chart i have (sometimes) first label of secondary Y axis negative, but i need first label = 0. i cann''t find answer (resolution) of my problem.

8 Replies

GM Geetha M Syncfusion Team February 23, 2006 01:02 PM UTC

Hi, I am afraid I am not able to reproduce the issue. I have attached a sample that I created that fits your description. Could you please try and reproduce the problem in the sample and send it back to me so that it I can resolve the problem accurately? Also please let me know the current version of Essential Studio you are using. F41088.zip Thanks and Regards, Geetha


GA garbika February 24, 2006 01:48 PM UTC

Hi Geetha, i don''t know how to explain my problem. first thing is that I have the newest version Essential Studios. i try to describe the whole progress how i create chart. (my code) i have three series and i calculate range for all axis need first and second series shown on top part of chart with primary Y axis and third series shown on bottom part of chart with secondary y axis i apologize for large code but i don''t know, where the bug is i apologize for my english too and for my program code i''m beginner on c#:))) attached please find a file with codes, points and pictures in one picture where the second y axis starts on value 38, i cann''t see differences for points 20 - 24 and i need to show all diferences for my client i hope that you understand me please if you can help me:(((( thanks g. >Hi, > >I am afraid I am not able to reproduce the issue. I have attached a sample that I created that fits your description. Could you please try and reproduce the problem in the sample and send it back to me so that it I can resolve the problem accurately? Also please let me know the current version of Essential Studio you are using. > >F41088.zip > >Thanks and Regards, >Geetha

chart_problem.zip


GM Geetha M Syncfusion Team March 14, 2006 02:43 PM UTC

Hi, We regret for the delayed response. Thanks for the sample code. But it seems that some data are missing in the code you sent. After looking into the sample images, it seems that the differences are not seen because of the Range type that is dynamically set. Please try setting the minimum range of the secondary axis less than that of minimum y value of the series. Kindly let me know if this helps you and if not, could you please send me back a simple sample which includes all the necessary details so that it would help me to solve the problem at the earliest? Regards, Geetha.


GA garbika March 20, 2006 03:24 PM UTC

hi thanks for your answer (tip), you are right. When i set the minimum range of secondary Y axis smaller than minimum y value (in my application i set Range.Min = MinY.Value - Range.Int/2) then i see all information, but first value which i see on secondary Y axis is not equal to minimum range defined by me. But i don''t understand this solution and sorry I don''t like it :( (i want a nice and correct chart) How should I set range of the secondary axis, when i know, that all my values are larger than zero and i want to have minimum value zero??? Where is my calculation wrong? (i need maximum range of secondary Y axis larger than 2*maximum value of relevant series) attached please find zip file with simple application, where is all my code which i use. and my next questions : first when you run my application, you will see chart (first), which has 31 * 24 (744) points. I set maximum range (x axis) equal 745, but my application has 1490 points on the x axis, please tell me why i have this count points. i see double count points into method : myChart_ChartFormatAxisLabel(object sender, Syncfusion.Windows.Forms.Chart.ChartFormatAxisLabelEventArgs e): if (e.IsAxisPrimary && e.AxisOrientation == ChartOrientation.Horizontal) { if (type == TypeInterval.Month) { e.Label = ""; if (e.Value == 0) inc = 0; else inc++; if ((inc % 24) == 12) e.Label = startPeriod.AddDays(inc /24).ToString("d MMM") + " "; } } second: when i have series (with second Y axis) which has values only zero i have error : An unhandled exception of type ''System.NullReferenceException'' occurred in system.windows.forms.dll Additional information: Object reference not set to an instance of an object. and i cann''t find where is this bug:( is it problem because i have range (0,0,0)??? methods in my application where i work with range informations are getRange(), change_range() please if you have time and if you can help me tell me where i have bug. thanks and i apologize for my english garbika >Hi, > >We regret for the delayed response. > >Thanks for the sample code. But it seems that some data are missing in the code you sent. > >After looking into the sample images, it seems that the differences are not seen because of the Range type that is dynamically set. Please try setting the minimum range of the secondary axis less than that of minimum y value of the series. > >Kindly let me know if this helps you and if not, could you please send me back a simple sample which includes all the necessary details so that it would help me to solve the problem at the earliest? > >Regards, >Geetha.

Chart3.zip


GM Geetha M Syncfusion Team March 21, 2006 02:20 PM UTC

Hi, Thanks for the sample. After checking the sample, I understood that the differences are not actually invisible. As the symbol circle used is of size (2,2) it is visible partially. This problem can be avoided by either increasing the size of the symbol or by reducing the ticksize of the PrimaryXAxis Labels to zero. The following code illustrates this: seriesDiff.Style.Symbol.Size = new Size(5,5); myChart.PrimaryXAxis.TickSize = new Size(0,0); As far as the null reference exception, if your aim is to avoid displaying the axis labels when the range is months, please try setting the Interval of the secYAxis to 0 which might be a better solution specific to this application. The following code illustrates this: private void cbMonth_CheckedChanged(object sender, System.EventArgs e) { if (cbMonth.Checked) { chart_data(Convert.ToDateTime("01/01/2006"), Convert.ToDateTime("01/31/2006")); secYAxis.Range.Interval = 0; } else secYAxis.Range.Interval = Int_diff; } Please let me know if this helps you. Regards, Geetha.


GA garbika March 22, 2006 10:12 AM UTC

hi, thanks for your answer but it''s not exactly what i meant ;( i''ll try to describe my problems/questions again and more accurately first problem is, that the value does not show - please have a look into my application day 01/12/2006 - 2 hour (first picture) or 01/14/2006 - 20 - 24 hour second: change cbMonth_CheckedChanged(..) i have tried your suggestion, but it does not seem to work as i could not see any of the labels at all after that this problem i solved with condition if (Int_diff != 0) { secYAxis.Range.Min = 0; secYAxis.Range.Max = Int_diff*11; secYAxis.Range.Interval = Int_diff; } else secYAxis.Range = new MinMaxInfo(-1, 12, 1); my questions were and are :) first : if you run my application you can see on the chart there are labels on the primaryXAxis between (1 Jan - 3 Mar), but i have values only for January. On the primaryXAxis i have double points and i don''t know why. (second picture) second : How should I set range of the secondary axis, when i know, that all my values are larger than zero and i want to have a minimum value zero??? Where is my calculation wrong? please could you explain to me how the chart paints or calculated our range value on the secondary axis? please find the attached file with picture of errors thanks for your answer and help g.

chart_problem2.zip


GM Geetha M Syncfusion Team March 23, 2006 02:28 PM UTC

Hi, Thanks for the update. Please have a look at the attached sample and images. This sample displays the chart for the month of January and the point illustrating 2 hour for 01/12/2006. Previously it was not displayed because the lower value at the y axis is 16.800 and the 2 hour value is 16. I have increased the size of the symbols and decreased the size of the ticks of the PrimaryXAxis to zero. The PrimaryXAxis was displaying 1490 points because of the interval set to 1. It needs the interval value to be set as 2 to display month chart. Also, I included a simple calculation to display the secondary y axis values correctly (from zero). Chart.zip I hope this helps you. Please let me know about it. Regards, Geetha.


GA garbika March 23, 2006 04:45 PM UTC

Thanks this is what i needed to correct calculation and that''s it.I just didn''t know where the problem is but you have solved my problem. many thanks g.

Loader.
Live Chat Icon For mobile
Up arrow icon