thanos
unread,Jan 15, 2012, 12:19:26 PM1/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Nitrogen Project / The Nitrogen Web Framework for Erlang
I would love some pointer on how I could set the values of the
#google_chart element dynamically ideally with comet.
Please excuse my ignorance...
right() -> [
#h2 { text="Line Chart" },
#google_chart {
id=myChart,
title="Line Chart", width=400, height=200, grid_x=25,
grid_y=33,
axes=[
#chart_axis { position=bottom, labels=["First", "Second",
"Third", "Fourth"] },
#chart_axis { position=left, labels=["Good", "Better",
"Best"] }
],
data=[
#chart_data { legend="Data 1", color="FF9900",
line_width=3, line_length=1, blank_length=3,
values=[10, 20, 30, 20, 30, 40, 40, 50, 60]
},
#chart_data { legend="Data 2", color="2768A9",
line_width=5,
values=[20, 50, 70, 90, 70, 40, 10, 1, 8]
}
]
},
.
.
.
wf:comet(fun() -> background_update(myChart, Data) end),
Body.
event(_) -> ok.
background_update(ChartID, Count) ->
timer:sleep(1000),
% Its here I'm lost as
wf:update(ChartID, ????),
wf:flush(),
background_update(ControlID, data:get_more_data()).