Page 1 of 1

Hello! How to express two graph

Posted: Thu Sep 25, 2014 9:16 pm
by 16668345
Hello~ ^^

I could not find a graph that represents the direction of the wind and wind velocity at the same time an example.

How can i fix this coding.. help me..

Code: Select all

'--------------------------------------------

Chart1.Legend.Visible=true  
  Chart1.Header.Text(0)= tag_no
  Chart1.Header.Font.Color=vbBlack
  Chart1.Header.Font.Bold=True
  Chart1.AddSeries(22)
  
  Chart1.Aspect.View3D=False
  Chart1.Panel.Gradient.Visible=false
  Chart1.Panel.Color=black
  Chart1.Panel.BevelOuter=1
  Chart1.Panel.BevelWidth=2
  Chart1.Axis.Bottom.Labels.Angle=0

if res.bof or res.eof then
else 
j = 1
Do until res.EOF				
				setday = res("sday")
				data2 = res("data2")
				 
Chart1.Series(0).Add data2, setday, clTeeColor    
  
res.MoveNext
j = j + 1

loop
end if  

Response.BinaryWrite (Chart1.Export.asNative.SaveToStream(True))

'---------------------------------------- 

Chart2.Legend.Visible=true  
  Chart2.Header.Text(0)= tag_no
  Chart2.Header.Font.Color=vbBlack
  Chart2.Header.Font.Bold=True
  Chart2.AddSeries(fastline)
  
  Chart2.Aspect.View3D=False
  Chart2.Panel.Gradient.Visible=false
  Chart2.Panel.Color=black
  Chart2.Panel.BevelOuter=1
  Chart2.Panel.BevelWidth=2
  Chart2.Axis.Bottom.Labels.Angle=0

if res2.bof or res2.eof then
else 
j = 1
Do until res2.EOF				
				setday = res2("sday")
				data = res2("data")
				 
Chart2.Series(0).Add data, setday, clTeeColor    
  
res2.MoveNext
j = j + 1

loop
end if  

Response.BinaryWrite (Chart2.Export.asNative.SaveToStream(True))
wind2.jpg
wind2.jpg (355.9 KiB) Viewed 11059 times

Re: Hello! How to express two graph

Posted: Fri Sep 26, 2014 11:05 am
by yeray
Hello,

I'm not sure to understand what's wrong in the resulting images you attached. Could you please explain what result would you expect?

Re: Hello! How to express two graph

Posted: Sat Sep 27, 2014 8:14 pm
by 16668345
Hi~

It's not result image... ^^;;;
it's want results....
and it's only one page source.

above image --- OK
below image ---- do not express

Re: Hello! How to express two graph

Posted: Mon Sep 29, 2014 11:22 am
by yeray
Hello,

I'm still not sure to understand what exact result would you expect.

I see the first chart seems to draw date times in the horizontal axis of the WindRose series, but I don't know if this is what you'd expect, what are setday and data2, what are they supposed to represent and which one is correctly represented in the image you posted, if any.
And the same for sday and data in the second chart.

Note the XValues in the WindRose represent the angle, and the YValues represent the radius of each point.
So, if you want to add points with angle and value, you should use AddXY. Ie:

Code: Select all

  TChart1.AddSeries scWindRose
  TChart1.Series(0).AddXY 15, 50, "", clTeeColor
  TChart1.Series(0).AddXY 30, 70, "", clTeeColor
  TChart1.Series(0).AddXY 45, 30, "", clTeeColor