gasolin escribió:
> Maram wrote:
>> HI,
>>
>> but how pass it in EasyPlot(id="diag", style="bar", width="300",
>> height="300",data=[setA, ]) ?
>>
>
> Maram:
> You can pass "option" params to EasyPlot(). You can glance the usage in
> Toolbox Widget browser.
There is not EasyPlot in my Toolbox... why?
The easy_install PlotKit... not work... the .egg is bad in default
repository. I download it, of another repository, an then use easy_install.
>
>
> class EasyPlotDesc(WidgetDescription):
> name = "EasyPlot"
> .....
>
> option = """{"xTicks": [{v:0, label:"zero"},
> {v:1, label:"one"},
> {v:2, label:"two"},
> {v:3, label:"three"},
> {v:4, label:"four"},
> {v:5, label:"five"}]}"""
> .......
> for_widget = EasyPlot(option= option,data=data)
>
>
I change the code in controllers, but the graph in the web page is empty.
class Root(controllers.RootController):
@expose(template="wgtest.templates.welcome")
def index(self):
data = [[0,0], [1,2], [2,3], [3,7], [4,8], [5,6]]
option='''{"xTicks":[{label: "zero", v: 0}, {label: "one", v:
1},{label: "two", v: 2}, {label: "three", v: 3},{label: "four", v:
4},{label: "five", v: 5}]}'''
return dict(ep= EasyPlot(style="bar", option=option, data=data) )
The html is:
<SCRIPT TYPE="text/javascript">
var data = [[0, 0], [1, 2], [2, 3], [3, 7], [4, 8], [5, 6]];
var plotter = EasyPlot("bar", {"xTicks":[{label: "zero", v: 0},
{label: "one", v: 1},{label: "two", v: 2}, {label: "three", v:
3},{label: "four", v: 4},{label: "five", v: 5}]}, $("diag"), data);
</SCRIPT>
What is bad ?
--
maram
http://maram.com.ar - http://geine.maram.com.ar
Ubuntu Linux User - TurboGears User
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---