Link to home
Start Free TrialLog in
Avatar of Melfeky
Melfeky

asked on

I want to customize this chart to fit into my db.

Hi all experts,
i have downloaded Flashchart products , and when i opened the ASP file to set the db connection and to select the records from the table i couldn't customize that to fit my db.
Here is the asp file which connects to the db and by the way the include file "flashchart_20.asp" contains the color setting of the chart.

<!-- #include file="flashchart_20.asp" -->
<%
Response.Expires=0
randomize timer
rvar=trim(request("r"))

Set conn=Server.CreateObject("Adodb.Connection")
cnpath="DBQ=" & server.mappath("DB1.mdb")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath & ";Uid=anonymous; Pwd="

'for example purposes, we set chartid=1
chartid=1

'Retrieve Chart Layout Values
vsql="select * from chart where chartid=" & chartid
Set rs=conn.execute(vsql)

chart_bgcolor=trim(rs("chart_bgcolor"))
chart_style=trim(rs("chart_style"))
chart_title=trim(rs("chart_title"))
chart_title_color=trim(rs("chart_title_color"))
chart_subtitle=trim(rs("chart_subtitle"))
chart_subtitle_color=trim(rs("chart_subtitle_color"))
chart_comment=trim(rs("chart_comment"))
chart_comment_color=trim(rs("chart_comment_color"))
chart_frame_bgcolor=trim(rs("chart_frame_bgcolor"))
chart_frame_style=trim(rs("chart_frame_style"))
chart_frame_border=trim(rs("chart_frame_border"))
chart_frame_size=trim(rs("chart_frame_size"))
chart_tooltip_color=trim(rs("chart_tooltip_color"))
chart_tooltip_style=trim(rs("chart_tooltip_style"))
chart_tooltip_border=trim(rs("chart_tooltip_border"))
chart_tooltip_bgcolor=trim(rs("chart_tooltip_bgcolor"))
chart_horizontal_grid=trim(rs("chart_horizontal_grid"))
chart_horizontal_grid_color=trim(rs("chart_horizontal_grid_color"))
chart_horizontal_label_color=trim(rs("chart_horizontal_label_color"))
chart_vertical_label_orientation="labelvertical" 'trim(rs("chart_vertical_label_orientation"))
chart_vertical_grid=trim(rs("chart_vertical_grid"))
chart_vertical_grid_color=trim(rs("chart_vertical_grid_color"))
chart_horizontal_title=trim(rs("chart_horizontal_title"))
chart_horizontal_text_color=trim(rs("chart_horizontal_text_color"))
chart_vertical_title=trim(rs("chart_vertical_title"))
chart_vertical_text_color=trim(rs("chart_vertical_text_color"))
chart_legend_text_color=trim(rs("chart_legend_text_color"))
chart_legend_style=trim(rs("chart_legend_style"))
chart_max_value=trim(rs("chart_max_value"))
chart_min_value=trim(rs("chart_min_value"))
'Retrieve Chart Data
vchart_initialize
vchart_set_bgcolor chart_bgcolor,chart_style
vchart_set_title chart_title, chart_title_color
vchart_set_subtitle chart_subtitle, chart_subtitle_color
vchart_set_comment chart_comment,chart_comment_color
vchart_set_frame chart_frame_bgcolor, chart_frame_style
vchart_set_frameborder chart_frame_border, chart_frame_size
vchart_set_tooltip chart_tooltip_color,chart_tooltip_style,chart_tooltip_bgcolor,chart_tooltip_border
vchart_set_legend chart_legend_text_color, chart_legend_style
vchart_set_horizontalgrid chart_horizontal_grid,chart_horizontal_grid_color
vchart_set_horizontalgridlabel chart_horizontal_label_color
vchart_set_verticalgrid chart_vertical_grid,chart_vertical_grid_color
vchart_set_horizontalgrid chart_horizontal_grid,chart_horizontal_grid_color
vchart_set_verticalgridlabelorientation chart_vertical_label_orientation
vchart_set_horizontaltitle chart_horizontal_text_color,chart_horizontal_title
vchart_set_verticaltitle chart_vertical_text_color,chart_vertical_title
vchart_set_minvalue chart_min_value
vchart_set_maxvalue chart_max_value
'Retrieve Series Data
vsql="select * from series where series_chartid=" & chartid & " order by seriesid"
Set rs=conn.execute(vsql)
do while not rs.eof
      seriesid=trim(rs("seriesid"))
      series_title=trim(rs("series_title"))
      series_type=trim(rs("series_type"))
      series_style=trim(rs("series_style"))
      series_bgcolor=trim(rs("series_bgcolor"))
      series_spacing=trim(rs("series_spacing"))
      
      vchart_add_series series_title, series_type, series_bgcolor, series_style, series_spacing
      
      'Retrieve Series data values
      vsql="select * from series_data where series_data_seriesid=" & seriesid & " order by series_dataid"
      Set ts=conn.execute(vsql)
      do while not ts.eof
            series_data_value=trim(ts("series_data_value"))
            series_data_label=trim(ts("series_data_label"))
            series_data_label_color=trim(ts("series_data_label_color"))
            vchart_add_series_data seriesid, series_data_value
            vchart_add_label series_data_label,series_data_label_color
      ts.movenext
      loop
rs.movenext
loop
vchart_show

set rs=nothing
set ts=nothing
conn.close
set conn=nothing
%>
My db is called DB1.mdb
and it has a table called "Weight" and has these column:
"Weightid"
"MEMBER_ID"
"currentweight"
"d_date"

Where i want the x-axis to display the values from the d_date and i want the y-axis to display the currentweight.
Could anyone help me in this.
Avatar of reginab
reginab

have you tried their website, they have some very nice online help there. adding data from adata base.  Go into the online help there, and then select flashchart, it is detailed and they have code examples, I would start their.  then you will have more of a code sample if you are still having trouble to bring here, really there is not enough above to really help.  I am not even sure if the above is for a line chart like you are trying to create.

Avatar of Melfeky

ASKER

I have searched in the website but i couldn't find any online support link here is a link to the site :http://flashcharts.mousepeople.com
would u provide me with a url with this link.
sorry, I thought you were using these guys, http://www.aurigma.com/Products/FlashChart/ not sure if they are related to yours or not, I would perhaps still go here, here it is still charts with asp and asp.net, and they do have code samples.

go here http://www.aurigma.com/Support/default.aspx?mainsrc=OnlineHelp.aspx and then in the left nav expand flashchart.  

lots of good information there.
Avatar of Melfeky

ASKER

is it free ?
how can i use it with ASP?
ASKER CERTIFIED SOLUTION
Avatar of reginab
reginab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Melfeky

ASKER

ok thanks ,
but i need something which is free
thanks for the points sorry this was not more help.
Avatar of Melfeky

ASKER

thanks,  u tried to help.
If u hve time would u look at this topic:
Q_21173148.html