User (Legacy) Posted February 13, 2007 Report Share Posted February 13, 2007 I have a dataset XML (dataset stored in xml format) stored in the database and for the archiving purpose I want to go directly to stored xml data and render chart from their instead of going to source database (faster speed and less space for summarized data) the problem i have is following: i read the xml data and convert back to dataset and attach dataset to chart and datagrid. Datagrid shows the data however chart does not show data. Please find xml (which i got it from dataset and stored as an xml) that i converting back to dataset <NewDataSet><ConfigData><YEAR>2006</YEAR><COUNT>54088</COUNT></ConfigData><C onfigData><YEAR>2007</YEAR><COUNT>8344</COUNT></ConfigData></NewDataSet> Is there a something i need to do on converted dataset to be compatible for Chart? I am using Charfx 2005. Best Regards, Dharmesh Trivedi Link to comment Share on other sites More sharing options...
Software FX Posted February 14, 2007 Report Share Posted February 14, 2007 You can pass the DataSet object instead of the file. The Chart FX Data XML format looks like this: <?xml version="1.0"?><CHARTFX> <COLUMNS> <COLUMN NAME="Product" TYPE="String"/> <COLUMN NAME="Q1" TYPE="Integer" DESCRIPTION="1ST QTR"/> <COLUMN NAME="Q2" TYPE="Integer"/> <COLUMN NAME="Q3" TYPE="Integer"/> <COLUMN NAME="Q4" TYPE="Integer"/> </COLUMNS> <ROW Product="ChartFX 98" Q1="9200" Q2="7835" Q3="10245" Q4="8762"/> <ROW Product="ChartFX IE 3.5" Q1="14350" Q2="11233" Q3="16754" Q4="987"/> <ROW Product="ReportFX" Q1="12398" Q2="7654" Q3="5678" Q4="9087"/> <ROW Product="Image Toppings" Q1="8742" Q2="12358" Q3="14321" Q4="8702"/></CHARTFX> For more information please refer to the programmer´s guide. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 15, 2007 Author Report Share Posted February 15, 2007 Francisco, I am converting xml to dataset and that dataset attached to datagrid fine howerver chart shows no data found message. Best Regards, Dharmesh Trivedi "Software FX" <noreply@softwarefx.com> wrote in message news:6xLtGVIUHHA.1212@webserver3.softwarefx.com... > You can pass the DataSet object instead of the file. > > The Chart FX Data XML format looks like this: > > <?xml version="1.0"?><CHARTFX> <COLUMNS> <COLUMN NAME="Product" > TYPE="String"/> <COLUMN NAME="Q1" TYPE="Integer" DESCRIPTION="1ST QTR"/> > <COLUMN NAME="Q2" TYPE="Integer"/> <COLUMN NAME="Q3" TYPE="Integer"/> > <COLUMN NAME="Q4" TYPE="Integer"/> </COLUMNS> <ROW Product="ChartFX 98" > Q1="9200" Q2="7835" Q3="10245" Q4="8762"/> <ROW Product="ChartFX IE 3.5" > Q1="14350" Q2="11233" Q3="16754" Q4="987"/> <ROW Product="ReportFX" > Q1="12398" Q2="7654" Q3="5678" Q4="9087"/> <ROW Product="Image Toppings" > Q1="8742" Q2="12358" Q3="14321" Q4="8702"/></CHARTFX> For more information > please refer to the programmer´s guide. > -- > Francisco Padron > www.chartfx.com > Link to comment Share on other sites More sharing options...
Software FX Posted February 15, 2007 Report Share Posted February 15, 2007 Can you please attach a sample project that reproduces the problem. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 16, 2007 Author Report Share Posted February 16, 2007 Please find it below DataSet xmlDS = new DataSet(); StringReader stream = null; XmlTextReader reader = null; string strXML="<NewDataSet><ConfigData><YEAR>2006</YEAR><COUNT>54088</COUNT></Confi gData><C onfigData><YEAR>2007</YEAR><COUNT>8344</COUNT></ConfigData></NewDataSet>" stream = new StringReader(strXML); reader = new XmlTextReader(stream); xmlDS.ReadXml(reader); if (xmlDS != null) return xmlDS; else return null; "Software FX" <noreply@softwarefx.com> wrote in message news:Myef46QUHHA.1212@webserver3.softwarefx.com... > Can you please attach a sample project that reproduces the problem. > > -- > Francisco Padron > www.chartfx.com Link to comment Share on other sites More sharing options...
Software FX Posted February 16, 2007 Report Share Posted February 16, 2007 And then you are doing what with xmlDS ? I tried assigning it to a DataGridView´s DataSource but got nothing. You said: > I am converting xml to dataset and that dataset attached to datagrid fine Where is that code ? -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
TrivediD Posted February 24, 2007 Report Share Posted February 24, 2007 Problem that I am having that dataset generated from XML attach to Datagrid fine however ChartFX does not show data. Please find the code below.I see data in datagrid however chart show "no data available" .. Pleasehelp.Best Regards,Dharmesh Trivediusing System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Text;using System.Web.UI.HtmlControls;using System.Collections;using System.ComponentModel;using System.Diagnostics;using System.Web.Services;using System.Xml;using System.IO;public partial class _Default : System.Web.UI.Page{ private wsPortalReportConfigDB.BIO.graphService wsObj = newwsPortalReportConfigDB.BIO.graphService(); protected void Page_Load(object sender, EventArgs e) { DataSet xmlDS = new DataSet(); StringReader stream = null; XmlTextReader reader = null; stream = newStringReader("<NewDataSet><ConfigData><YEAR>2006</YEAR><COUNT>54088</COUNT></ConfigData><ConfigData><YEAR>2007</YEAR><COUNT>8344</COUNT></ConfigData></NewDataSet>"); reader = new XmlTextReader(stream); xmlDS.ReadXml(reader); GridView1.DataSource = xmlDS; GridView1.DataBind(); Chart1.DataSource = xmlDS; Chart1.DataBind(); }"Software FX" <noreply@softwarefx.com> wrote in messagenews:fPf#POgUHHA.620@webserver3.softwarefx.com...> And then you are doing what with xmlDS ?>> I tried assigning it to a DataGridView's DataSource but got nothing.>> You said:> > I am converting xml to dataset and that dataset attached to datagridfine>> Where is that code ?>> -- > Francisco Padron> www.chartfx.com Link to comment Share on other sites More sharing options...
Frank Posted February 26, 2007 Report Share Posted February 26, 2007 The problem is both COUNT and YEAR are STRING columns . That is the type in the DataSet. The grid is showing them as strings, you can tell by the alignment. Obviously the chart needs numbers to plot, since it didn't find any it displays an empty plot. You can do: 1) Setup your dataset columns so that they are the appropriate type. For this you need to read the schema: xmlDS.ReadXmlSchema(schemaReader);2) Tell Chart FX to convert these strings to numbers: Chart1.DataSourceSettings.Fields.Add(new ChartFX.WebForms.FieldMap("YEAR",ChartFX.WebForms.FieldUsage.Value)); Chart1.DataSourceSettings.Fields.Add(new ChartFX.WebForms.FieldMap("COUNT",ChartFX.WebForms.FieldUsage.Value)); Note: Chart FX will fail if the contents of the data are not numbers Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.