-1000,-100,-10,0,10,100,1000 should be equidistant ticks on the x-axis
and should represent these values.
What I'm referring to works fine on the old Google Visualization
Charts (see my code below).
However it doesn't work on the new corecharts.
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["barchart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'item');
data.addColumn('number', 'sales');
data.addRow(["a", -1000]);
data.addRow(["b", -100]);
data.addRow(["c", -10]);
data.addRow(["d", -1]);
data.addRow(["e", -0.5]);
data.addRow(["f", 0]);
data.addRow(["g", 0.5]);
data.addRow(["h", 1]);
data.addRow(["i", 10]);
data.addRow(["j", 100]);
data.addRow(["k", 1000]);
var chart = new
google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, {width: 800, height: 300, logScale:true });
}
</script>
</head>
<body>
<div id="chart_div"></div>
</body>
</html>
On Aug 10, 6:46 pm, Badtnik <[email protected]> wrote:
> Hi
>
> So you are suggesting the bars should not at all be affected by
> logScale=true?
> I mean, for what I understand, the purpose of logarithmic scale is indeed to
> show a 'distorted' version of the data to help display very large value
> alongside very small values. so 0.001 and 10000 can both have reasonably
> sized bars representing them instead of the former being less then 1 pixel
> high.
>
> Can you sketch some example of how you would like to see a lograthmic scaled
> chart of some example data ?
> Badtnik
>
> On Tue, Aug 10, 2010 at 5:23 PM, Adam <[email protected]> wrote:
> > Hi Badtnik
>
> > I will try to clarify what I meant.
> > As an example, let's take a Column Chart with logScale=true.
> > In this case the y-axis will be labeled in a logarithmic fashion
> > (example 0, 10, 100, 1000 ...)
> > However, the column values are not logarithmic - they are the real
> > values. So for example, a column having a real value of 1000 will
> > correspond to the 1000 y-axis label.
>
> > Since the data values are the real data values and not logarithms, I
> > don't see any problem having the same method of logarithmic labeling
> > of the negative y-axis.
>
> > On Aug 10, 12:55 pm, Badtnik <[email protected]> wrote:
> > > Hey Adam
>
> > > What you are suggesting is interesting but might cause a lot of
> > confusion,
> > > for example:
> > > - the values -10 and 1/10 will be positioned in the same height
> > > - the value 0.5 will be positioned lower than -0.5
> > > In general, the positioning function you are suggesting is not monotone
> > nor
> > > is it continuous.
>
> > > Wikipedia:http://en.wikipedia.org/wiki/Logarithmic_scaleseemsto only
> > > describe logarithmic scale of positive values
> > > Do you have any reference to literature or an example of a well known
> > > charting tool that behaves that way?
>
> > > Badtnik
>
> > > On Mon, Aug 9, 2010 at 6:30 PM, Adam <[email protected]> wrote:
> > > > Why does the logScale configuration option of the Column and Bar
> > > > Charts require all values to be positive? (according the the
> > > > documentation)
>
> > > > There is no reason for negative values not to have a log scale. The
> > > > scale should be calculated according to the absolute values of the
> > > > data. So the negative log scale would be something similar to -1, -10,
> > > > -100, ...
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Visualization API" group.
> > > > To post to this group, send email to
> > > > [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<google-visualization-api%[email protected]>
> > <google-visualization-api%[email protected]<google-visualization-api%[email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-visualization-api?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-visualization-api%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-visualization-api?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.