Details for x-axis are:-XRangeMin value is =0.0001 and XRangeMax value is=200 for Log scale.Details for Y-axis are:-YRangeMin=0 and YRangeMax=30060.079 for Linear scaleThe graph display at my end is In above graph we can see that x-axis scale points are(0,0,0,0.1,1,10,100,1000)But it should display the x-axis scale points(1e-4,0.001,0.01,0.1,1,10,100,1000) as shown in graph below:-
How can achive this in Ultrachart.Please help me.
Hello Mdsat,
Did my sample project answer your question?
Hello,
I wasn't able to get a sample working the way you wanted with the code you provided, but I was able to by doing everything in the designer. Take a look at the sample project I've attached and if it answers your question, verify this post as the answer.
Code snippet:-
private void SetChartTypeAndAxisLabels(){ mChart.ChartType = ChartType.ScatterChart; mChart.ScatterChart.ConnectWithLines = true; mChart.ScatterChart.LineAppearance.Thickness = 1; mChart.ScatterChart.Icon = SymbolIcon.None; System.Collections.Hashtable axisLabelHashTable = new System.Collections.Hashtable(); axisLabelHashTable.Add("YDATA_VALUE", new YAxisLabelRenderer()); axisLabelHashTable.Add("XDATA_VALUE", new XAxisLabelRenderer()); mChart.LabelHash = axisLabelHashTable;
mChart.Axis.Y.Labels.ItemFormatString = "<YDATA_VALUE>"; mChart.Axis.X.Labels.ItemFormatString = "<XDATA_VALUE>"; mChart.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom; mChart.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom; mChart.Legend.Visible = false;}
private void SetXAxisTypeAndRange(NumericAxisType axisType, double rangeMin, double rangeMax){ if (axisType == NumericAxisType.Logarithmic) { Chart.Axis.X.MinorGridLines.Visible = true; Chart.Axis.X.NumericAxisType = NumericAxisType.Logarithmic; Chart.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval; Chart.Axis.Y.TickmarkIntervalType = AxisIntervalType.NotSet; Chart.Axis.Y.MajorGridLines.DrawStyle = LineDrawStyle.Solid; Chart.Axis.Y.MinorGridLines.DrawStyle = LineDrawStyle.Dash; Chart.Axis.X.TickmarkInterval = 1; Chart.Axis.X.RangeMin = rangeMin; Chart.Axis.X.RangeMax = rangeMax; Chart.Axis.X.MinorGridLines.Visible = true; Chart.Axis.X.RangeType = AxisRangeType.Custom;
} else { Chart.Axis.X.NumericAxisType = NumericAxisType.Linear; Chart.Axis.X.RangeMin = mXAxisDetails.RangeMin; Chart.Axis.X.RangeMax = mXAxisDetails.RangeMax; Chart.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval; Chart.Axis.X.TickmarkInterval = (Chart.Axis.X.RangeMax - Chart.Axis.X.RangeMin) / NUMBEROFAXISLABELS; Chart.Axis.X.MinorGridLines.Visible = false; } Chart.Axis.X.LogBase = 10;}
public void RenderGraph(){ SetChartTypeAndAxislabels(); // xMin and xMax are the user inputs for example i have given the hard coded values. SetXAxisTypeAndRange(NumericAxisType.Logarithmic,0.001,1000);}hope the code snippet will help u to find the exact problem
No,this did not solve the problem.
Look at the Axis.X.Labels.ItemFormatString property. You should be able to add more '#'s to the format string. Let me know if doing so resolves your issue.