Jump to content
Software FX Community

ChartFx map data via sql


gaurav
 Share

Recommended Posts

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 ...

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...