Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Horizontal bar chart not supported on Logarithmic scale (Read 3286 times)
abhi dhotre
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Jul 12th, 2017
Horizontal bar chart not supported on Logarithmic scale
Aug 30th, 2017 at 5:30pm
Print Post  
Bar chart works while using a logarithmic scale but when I change the orientation of the chart to horizontal it throws an exception. Same is the case when I set bar chart layout to stack instead of side by side.

Thanks
Abhi D
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Horizontal bar chart not supported on Logarithmic scale
Reply #1 - Aug 31st, 2017 at 5:49am
Print Post  
The following changes in LogChart example will display X as logarithmic scale -

Code
Select All
public Form1()
{

//...

originalData.YAxisLabelsDataField = "Labels";

//...

barChart.XAxis.CustomFormat = new LogCustomFormatter();
barChart.XAxis.Interval = 1;
barChart.XAxis.MaxValue = 8;

//...

barChart.ShowYCoordinates = false;
barChart.HorizontalBars = true;
}
DataTable CreateSampleData()
{
    //...
    row[0] = values[i];
    row[2] = labels[i];
    row[1] = ++i;
   //...
}
class LogSeriesAdapter : Series
 {
//...
public double GetValue(int index, int dimension)
  {
   if (dimension == 0)
    return Math.Log10(series.GetValue(index, dimension));
   return series.GetValue(index, dimension);
  }
//...
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
abhi dhotre
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Jul 12th, 2017
Re: Horizontal bar chart not supported on Logarithmic scale
Reply #2 - Sep 6th, 2017 at 6:30pm
Print Post  
This code works only if I use side by side bar layout. I want to have stack bar layout, it gives me overflow error if I use stack bar layout
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Horizontal bar chart not supported on Logarithmic scale
Reply #3 - Sep 6th, 2017 at 7:46pm
Print Post  
The LogChart example does not throw exception if I switch to stacked bars. What call stack does the debugger show when it happens for you?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint