Hello,
How can I use UltraChart with logarithmic grid lines for X or Y axes? I'm not speaking of logarithmic scale for X or Y axis, but to draw the grid itself, like what's shown in http://en.wikipedia.org/wiki/Image:600px-LinLogScale.png
Regards
MG
Hi,
I'm also trying to plot a lin-log scale using Infragistics 7.1.20071.1055. I read somewhere that there is a bug with the log scale that may be present in this version. Can someone confirm this?
As a test, I've tried plotting the values 10 to 7400 in increments of 10 (so, 10, 20, 30 etc) and setting the Y-Axis to linear and the X-Axis to logarithmic. The result is I'm getting a plot that looks like the following:
Sorry, it might be hard to see, I am having trouble figuring out how to get pictures to show up nicely on this forum...
1. Why am I showing two lines, shouldn't the plot show something similar to the green plot in the Wikipedia link quoted above?
2. How do I make the X-Axis grid lines at equal distance.
My chart is using these properties:
m_Chart->Axis->X->LogBase = 10;
m_Chart->Axis->X->NumericAxisType = NumericAxisType::Logarithmic;
m_Chart->Axis->X->Extent = 24;
m_Chart->Axis->X->TickmarkIntervalType = AxisIntervalType::NotSet;
m_Chart->Axis->X->TickmarkStyle = AxisTickStyle::DataInterval;
m_Chart->Axis->X->TickmarkInterval = 1;
m_Chart->Axis->X->RangeMin = 1.0;
m_Chart->Axis->X->RangeMax = 1000.0;
m_Chart->Axis->X->RangeType = AxisRangeType::Custom;
DataTable dt = new DataTable();dt.Columns.Add("col1", typeof(int));dt.Columns.Add("col2", typeof(int));for (int i = 10; i < 2000; i++){ dt.Rows.Add(new object[ { i, i*10 });}
ultraChart1.ChartType = ChartType.ScatterChart;ultraChart1.Data.DataSource = dt;ultraChart1.ScatterChart.ColumnX = 0;ultraChart1.ScatterChart.ColumnY = 1;ultraChart1.Axis.X.NumericAxisType = NumericAxisType.Logarithmic;ultraChart1.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;ultraChart1.Axis.X.TickmarkInterval = 1;
I see.I was able to reproduce the graph that you have attached using the same data and using a ScatterChart.However, on my above chart, I was using a line chart and a Numeric Series. I still get the chart with two lines and non-equally spaces X-Axis.NumericSeries pSeries = new NumericSeries();for (int i = 1; i < 75, ++i){ String sLabel = Convert.ToString( i*10 ); pSeries.Points.Add( new NumericDataPoint( i*10, sLabel, false );}
m_Chart.Axis.X.MajorGridLines.Visible = true;m_Chart.Axis.X.LogBase = 10;m_Chart.Axis.X.NumericAxisType = NumericAxisType.Logarithmic;m_Chart.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;m_Chart.Axis.X.TickmarkInterval = 1;m_Chart.ChartType = ChartType.LineChart;m_Chart.Series.Clear();m_Chart.Series.Add( pSeries );
Is there a way to get the same result with a LineChart? Also, if I use scatter plot, can I get it to use the NumericDataSeries?
Let me know if you need more code.
I'm now using XYSeries with ScatterPlot and it's working much better. Thanks Max.
Sorry, but LineChart types cannot use a numeric X axis. If you're using a line chart the x axis is a string type and every label is interpreted as a string. That's basically like taking a log of "apples". You should use a scatter chart and replace NumericSeries with XYSeries, where you have to specify the x and the y values. As for having a line, simply set chart.ScatterChart.ConnectWithLines = true