Code Monkey home page Code Monkey logo

open-flash-chart-python's Introduction

OpenFlashChart Python Library

This project aims to provide a Python library for creating the data strings required by Open Flash Chart to render graphs.

Python version 2.5 or later is required (limited testing with Python 3.0). I haven't had a chance to test the latest version on Python 2.4.

Open Flash Chart is an interactive chart viewer written in ActionScript. Open Flash Chart is an open source project. At the minimum, Open Flash Chart version 1 requires Adobe Flash Player version 8 while Open Flash Chart version 2 requires Adobe Flash Player 9.

  • Open Flash Chart 1 uses comma delimited strings.
  • Open Flash Chart 2 uses JavaScript Object Notation (JSON).

VersionOne and VersionTwo provide a short description of the libraries for version 1 and 2 of Open Flash Chart.

The change log for both versions can be found in the Wiki: ChangeLog

Very short tutorials can be found in the Wiki: Tutorial

open-flash-chart-python's People

Contributors

eyip002 avatar

Watchers

James Cloos avatar  avatar

open-flash-chart-python's Issues

Make Libraries compatible with Python 3000

Python 3000 has been released but is not backward compatible with prior 
versions.  Because of this, 
the parts of the existing Open Flash Chart libraries may (or may not) need to 
be rewritten to be 
compatible with Python 3000.

1. Source code should be checked for incompatible Python 3000 syntax.
2. Changes should then be made.

Original issue reported on code.google.com by [email protected] on 7 Dec 2008 at 6:45

Seemingly random paste on openFlashChart_elements.py", line 28

FYI, there's a seemingly random paste in this file - deleting it fixes 
open-flash-chart-python.

What steps will reproduce the problem?
1. Download and extract Python_2.02.zip
1. Run demo.py in OFC2 folder

What is the expected output? What do you see instead?
# python demo.py 
Traceback (most recent call last):
  File "demo.py", line 17, in ?
    import      openFlashChart
  File "/root/OFC2/openFlashChart.py", line 19, in ?
    from        openFlashChart_elements import (title,
  File "/root/OFC2/openFlashChart_elements.py", line 28
    self['style'] = style if style else '{color: #000000; font-size: 
12px;}'

Cheers,

Mike

Original issue reported on code.google.com by [email protected] on 23 Jan 2009 at 3:22

Add set_colours to Bar_Stack()

This is not a defect, it's more of an enhancement. But I didn't find a way
to set this to be an "Enhancement". Maybe only developers can assign that
category.

While working with this library I've had some problems dealing with colors
and Stacked Bars. In essence, the only way to assign multiple colors for
all the stacked bars is defining Bar_Stack() with the positional parameter
"colours". This is a bit inconvenient when you want to assign the same
colors to your stacked bars as to the keys (titles) when you have a
variable number of stacked bars.

An improvement could be to define Bar_Stacked this way:
class Bar_Stack(varieties):
    def __init__(self, alpha = None, colour = None, text = None, fontsize =
None, values = None, colours = None):
        varieties.__init__(self, 'bar_stack', alpha, colour, text, fontsize,
values)
        if colours:
            self.set_colours(colours)
    def set_colours(self,colours):
        self['colours'] = colours

Or did I not see there was a way to do this before my modification? (as
last time I submitted something o.O)

Cheers, and great project!

Original issue reported on code.google.com by [email protected] on 21 Nov 2008 at 9:15

x and y legend not working

What steps will reproduce the problem?
Try to create x or y legend:

chart = Chart()
...
chart.x_legend.text = "My Chart"

What is the expected output? What do you see instead?
x or y legend is expected, got nothing, i.e. empty chart.
Without the x_legend def I get a chart.

What version of the product are you using? On what operating system?
Latest. OpenSuSE 11.1.

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 31 Jan 2010 at 11:55

'value' doesn't take 0 as a value

I don't know if it is the desired behaviour or a bug, but in case the value
is 0, it is considered as 'None', because the tests in the class 'value'
are not precise enough

class value(dict):
    ...
    def set_val(self, val):
        if val:                 # And what about the case val == 0 ?
            self['value'] = val


Original issue reported on code.google.com by [email protected] on 30 Mar 2010 at 9:00

too many values to unpack on OFC2

I am trying to make a pie chart and change labels, but It returns "too many
values to unpack" error.

This is my code:


      colours = ["#d01f3c","#356aa0","#C79810"]
      data = []

      data[0] = pie_value(10, "prova")
      data[1] = pie_value(20, "123123")
      data[2] = pie_value(70, "sdfas")


      pie = Pie(colours=colours, values=data_new, animate=True, start_angle=35)

      pie.set_tooltip('#val# of #total#<br>#percent# of 100%')


      chart = openFlashChart.template("Torta")

      chart.add_element(pie)


      binaryStuff = chart.encode()



Original issue reported on code.google.com by [email protected] on 30 Jan 2009 at 4:39

JSON Error with floating point values

What steps will reproduce the problem?
1. Create a line chart with "small values"

What is the expected output? What do you see instead?
A correct diagram

When using small floating point values as data points for my graph, I get
the following error:

pen Flash Chart

JSON Parse Error [Bad Array]
Error at character 58, line 1:

0: {"elements": [{"values": [0.000123017874497, 4.49195939269e-05,
4.3083864701e-05, 2.74165752781e-05, 2.74165752781e-

Any idea how to work aorund?

Original issue reported on code.google.com by [email protected] on 27 Apr 2009 at 3:33

x_axis labels not being displayed

What steps will reproduce the problem?
1. Try to render a graph with custom x_axis labels.
2. Your labels will not show up.

After looking at this output
(http://teethgrinder.co.uk/open-flash-chart-2/gallery/horizontal-bar-chart.php)
I realized that the x_axis label object needs another object inside.

I corrected the problem by adding one line to the x_axis constructor:
class x_axis(axis):
    def __init__(self, stroke = None, tick_height = None, colour = None,
grid_colour = None, labels = None, three_d = None, max = None, min = None,
steps = None, offset = None):
        axis.__init__(self, stroke, colour, grid_colour, labels, max, min, steps,
offset)
        self.set_tick_height(tick_height)
        self.set_3d(three_d)
+       self['labels'] = axis(labels=labels)

That last line corrects the problem, but I don't know if that is a good
implementation (I still don't comprehend entirely how python maps code to
json).

Original issue reported on code.google.com by [email protected] on 17 Nov 2008 at 6:53

3D charts and copy image locally?

Hi,

 Thanks for the great job. I have two question:
 1. Does the version two have the full functionalities especially the 3D
libraries?
 2. How to copy image locally with this version?

Thanks,

Erming


Original issue reported on code.google.com by [email protected] on 16 Dec 2009 at 8:37

Line graph shows 'NaN' for 0 values of 0 in Python library

What steps will reproduce the problem?
1. Creating a openFlashChart_varieties.value which has a value of 0 for a line
2.
3.

What is the expected output? What do you see instead?
I expect the line graph to simply plot a dot where "0" should be. Instead,
it plots the dot at the very top of the graph with "NaN" as the value

What version of the product are you using? On what operating system?
Version 2. I am running Ubuntu linux

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 28 Mar 2009 at 5:24

Support for Radar Spoke Label

What steps will reproduce the problem?
1. Create a radar spoke label 
    chart.radar_axis.spoke_labels.labels = k
    chart.radar_axis.spoke_labels.colour = "#9f819f"


2. it will give a error
3.


Please provide any additional information below.

Fixed by adding a entry in 
replaceKeyDictionary

"spoke_labels": "spoke-labels"

Original issue reported on code.google.com by [email protected] on 15 Jan 2010 at 1:02

Implement "shape" and "shape_point" classes

Shapes should be made available in the Python library.

The expected JSON string should be:
   { "type": "shape", "colour": "#FA6900", "values": [ { "x": 5.9, "y": -0.5 } ] }

For the following Python code:
  import openFlasChart
  from openFlashChart_varieties import Shape
  from openFlashChart_varieties import Shape_Point

  point = Shape(colour = '#FA6900')
  point.append_value(shape = Shape_Point(x = 5.9, y = -0.5))

  chart = openFlashChart.template("Chart title")
  chart.add_element(point)
  return chart.encode()

Original issue reported on code.google.com by [email protected] on 15 Nov 2008 at 3:28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.