Jump to content
Software FX Community

ChartFx map data via sql


gaurav

Recommended Posts

Posted

can any1 help to adjust data from sql source to map... i am getting confused with the label link file. is it necessary to have exactly the same countries as the links.xml file in sql result data which needs to be adjusted... how does chartfx link the data returned by the sql query to map because when i have certain results reuturned for some countries (not all countries are present in my db) the map(world countries) all turn blue even when i havent specified the value for some countries..... (logically it is null and hence those countries should not have color blue)

i am getting confused ... please help me ...

Posted

No all elements in the map have to appear in the DB, but all the items in the DB must correspond to an element in the map.

Elements not present in the resultset will be given the default attributes.

The label link file is a map between what's on your database and what's in the map, so if for example your DB uses 3 letter abbreviation for the state and our map uses a two letter abbreviation then you need a label link file to do this mapping.

Did you look at the sample programs provided?

Can you post a sample project that reproduces the issue?

 

Posted

 can u please explain how can i assign data from sql  to the map.my query returns (a) countryname and (b)ElectricyUse (Float) . How does chartfx assign data to the map directly . can you provide my with a sample .cs to export data from sql and assign colours to them based on the values returned,  because all your examples use results from text files.

Posted

Basically the way to connect Chart FX to SQL is as follows:

string mySelectQuery = "SELECT * from FinancialData";string myConnectionString = string.Format("Provider=Microsoft....);System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(myConnectionString);System.Data.DataSet ds = new System.Data.DataSet();System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(mySelectQuery, myConnection);adapter.Fill(ds, "MapsSQLConn");Chart FX Maps will handle the data and assign colors base on Conditional attributes using the code bellow:chart1.ConditionalAttributes.Add(new ConditionalAttributes());chart1.ConditionalAttributes.Add(new ConditionalAttributes());chart1.ConditionalAttributes.Add(new ConditionalAttributes());chart1.ConditionalAttributes[0].Condition.To = 500;chart1.ConditionalAttributes[0].Color = Color.Red;chart1.ConditionalAttributes[1].Condition.From = 500;chart1.ConditionalAttributes[1].Condition.To = 1000;chart1.ConditionalAttributes[1].Color = Color.Yellow;chart1.ConditionalAttributes[2].Condition.From = 1000;chart1.ConditionalAttributes[2].Color = Color.Green;

More detailed information and full CS samples can be found in the Resource Center installed by Chart FX, section Chart FX Extensions/Chart FX Maps/ Working with Data.In addition, our Technical Support department will be happy to assist you with further questions. Please send an email to Support@SoftwareFX.com to my attention and I will reply to any further inquire.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...