Sections
Timeline
Browse Source
New Ticket
Sub-Sections
Download
Comma-delimited Text
Tab-delimited Text
RSS Feed
Metanav
Preferences
About Trac
Links
Slowchop Studios
Gerald Kaszuba
Advertisement

Ticket #12 (closed defect: invalid)

Opened 3 months ago

Last modified 2 months ago

Bug with data scaling?

Reported by: anonymous Owned by:
Priority: trivial Version:
Keywords: Cc:

Description

I recently switched from 0.2.0 to 0.2.1 and some of my charts are now displaying differently, here is an example:

chart = StackedHorizontalBarChart(270, 20)
chart.set_colours(['fb7e01', 'f8f8f8'])

chart.add_data([50])
chart.add_data([100])

print chart.get_url()

0.2.0 http://chart.apis.google.com/chart?cht=bhs&chs=270x20&chd=s:f http://chart.apis.google.com/chart?cht=bhs&chs=270x20&chd=s:f,9&chco=fb7e01,f8f8f8

0.2.1 http://chart.apis.google.com/chart?cht=bhs&chs=270x20&chd=s:A http://chart.apis.google.com/chart?cht=bhs&chs=270x20&chd=s:A,9&chco=fb7e01,f8f8f8

Based on the outputted chart, the 0.2.0 versions produces the intended result. If this is not a data scaling bug, I would appreciate a hint how to achieve the output of the 0.2.0 version with 0.2.1

Attachments

Change History

Changed 2 months ago by anonymous

  • priority changed from critical to trivial
  • status changed from new to closed
  • resolution set to invalid

In 0.2.0, scaling assumed 0 as the lowest value, where 0.2.1+ scaling adjusts to the min and max value of the data given. In your case, 50 is the min and 100 is the max so the range is 50 starting from 50.

If you want to replicate 0.2.0's logic, when creating the graph specify the range values like so:

chart = StackedHorizontalBarChart(270, 50, x_range=[0, 100])

It produces the URL you want.

Add/Change #12 (Bug with data scaling?)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.