not sure why it truncates the message
method
def areahollow
data = []
labels=[]
31.times do |x|
temp = Math.sin(x * 0.2) * 1.9
data << temp
labels << ((temp * 100).to_i.to_f / 100.0).to_f
end
title = Title.new("Area Chart")
title.set_style( "{font-size: 20px; color: #F24062; text-align: center;}" );
chart = OpenFlashChart.new
chart.set_title(title)
area = AreaHollow.new()
area.width = 2
area.dot_style = HollowDot.new
area.colour = '#838A96'
area.fill = '#E01B49'
area.fill_alpha = 0.4
area.values = data
chart.add_element(area)
y = YAxis.new
y.set_range(-2,2,2)
x = XAxis.new
x_labels = XAxisLabels.new
x_labels.set_vertical()
x_labels.labels = labels
x.set_labels(x_labels)
chart.y_axis = y
chart.x_axis = x
chart.add_element(area)
render :text => chart.to_s
end
output in the web browser but the graph does not show
{"title":{"text":"Area Chart","style":"{font-size: 20px; color: #F24062; text-align: center;}"},"elements":[{"fill-alpha":0.4,"colour":"#838A96","fill":"#E01B49","values":[0.0,0.377471728510616,0.739894850386436,1.07282069945057,1.36297657270909,1.598794871135,1.77087426333773,1.87235448697807,1.89918984577886,1.85031049866857,1.7276651109688,1.53614316725722,1.28338004304719,0.979452606460782,0.636477485296219,0.268128015313748,-0.110910872512402,-0.48552809385098,-0.84078884226022,-1.16252999279117,-1.43792474108506,-1.65599396758582,-1.80804394039008,-1.88801290690358,-1.8927127567881,-1.82195612185996,-1.67856384586829,-1.46825252635638,-1.19940661195741,-0.882744140886138,-0.530889446577959],"type":"area_hollow","dot-style":{"type":"hollow-dot"},"width":2},{"fill-alpha":0.4,"colour":"#838A96","fill":"#E01B49","values":[0.0,0.377471728510616,0.739894850386436,1.07282069945057,1.36297657270909,1.598794871135,1.77087426333773,1.87235448697807,1.89918984577886,1.85031049866857,1.7276651109688,1.53614316725722,1.28338004304719,0.979452606460782,0.636477485296219,0.268128015313748,-0.110910872512402,-0.48552809385098,-0.84078884226022,-1.16252999279117,-1.43792474108506,-1.65599396758582,-1.80804394039008,-1.88801290690358,-1.8927127567881,-1.82195612185996,-1.67856384586829,-1.46825252635638,-1.19940661195741,-0.882744140886138,-0.530889446577959],"type":"area_hollow","dot-style":{"type":"hollow-dot"},"width":2}],"y_axis":{"steps":2,"max":2,"min":-2},"x_axis":{"labels":{"rotate":270,"labels":[0.0,0.37,0.73,1.07,1.36,1.59,1.77,1.87,1.89,1.85,1.72,1.53,1.28,0.97,0.63,0.26,-0.11,-0.48,-0.84,-1.16,-1.43,-1.65,-1.8,-1.88,-1.89,-1.82,-1.67,-1.46,-1.19,-0.88,-0.53]}}}