Current Position:Home > Flex Charting Weirdness

Flex Charting Weirdness

Update:11-30Source: network consolidation
Advertisement
I'm trying to display a "Gantt Chart" type chart using Ely's
example here:
http://demo.quietlyscheming.com/ChartSampler/app.html
(Series Types -> Columns & bars -> Floating Bars). This
is really perfect for what I'm trying to do.
I was pretty happy... until I put in my own data. After
entering in my own data - I don't know - it's displaying phantom
info... I'm really not sure where it's getting the data from. The
first two items that show up are correct, but the rest of the items
are just - whacked. The start point is incorrect, the bar length is
wrong... I've tried changing the values just to see what would
happen... and it simply doesn't display the correct information. It
seems to me like a chart that doesn't display the values correctly
isn't very useful - but perhaps I'm just doing something wrong. I
was hoping someone would have some insight.
Ely uses an xml file to render the data, with the only values
being used in the chart being "revenue" (the start point for the
bar) and "costs" (the length of the bar).
<YearlyData>
<Sample month="January" revenue="120" costs="45" />
<Sample month="February" revenue="108" costs="42" />
<Sample month="March" revenue="150" costs="82" />
<Sample month="April" revenue="170" costs="44" />
<Sample month="May" revenue="250" costs="57" />
<Sample month="June" revenue="200" costs="33" />
<Sample month="July" revenue="145" costs="80" />
<Sample month="August" revenue="166" costs="87" />
<Sample month="September" revenue="103" costs="56" />
<Sample month="October" revenue="140" costs="91" />
<Sample month="November" revenue="100" costs="42" />
<Sample month="December" revenue="182" costs="56" />
<Sample month="May" revenue="120" costs="57" />
</YearlyData>
And here's the chart code:
<Model id="dataSet" source="/data/sampleData.xml" />
<BarChart id="chart" width="100%" height="100%"
dataProvider="{dataSet.Sample}">
<series>
<BarSeries xField="revenue" minField="costs"/>
</series>
<verticalAxis>
<CategoryAxis categoryField="month" />
</verticalAxis>
</BarChart>
So, all i did was change the values "revenue" to "start" and
"costs" to "duration".
So here's my xml: <YearlyData>
<Sample month="CBCS Final Signoff" start="28"
duration="2" />
<Sample month="Design Revisions" start="27" duration="2"
/>
<Sample month="Copy Revisions" start="26" duration="2"
/>
<Sample month="Legal Approval" start="18" duration="7"
/>
<Sample month="Design Revisions" start="17" duration="2"
/>
<Sample month="Copy Revisions" start="16" duration="2"
/>
<Sample month="BP Internal Routing" start="13"
duration="3" />
<Sample month="CBCS Review" start="11" duration="2"/>
<Sample month="Design Concepts" start="6" duration="5"
/>
<Sample month="Copy Concepts" start="1" duration="5"
/>
<Sample month="Project Kick-off" start="0" duration="1"
/>
</YearlyData>
And my Chart code:
<Model id="dataSet" source="/data/sampleData.xml" />
<BarChart id="chart" width="100%" height="100%"
dataProvider="{dataSet.Sample}">
<series>
<BarSeries xField="start" minField="duration"/>
</series>
<verticalAxis>
<CategoryAxis categoryField="month" />
</verticalAxis>
</BarChart>
When you run his data it appears to all be charted correctly,
when you run mine the top two items are correct, 3 on down are just
- I don't know - it's just all wrong.
Any ideas would be appreciated.

The Best Answer

Advertisement
I ran your data with the below code and all the data was
displayed correctly.
<mx:Model id="dataSet" source="sampleData.xml" />
<mx:BarChart id="chart" width="391" height="278"
dataProvider="{dataSet.Sample}" x="32" y="269">
<mx:series>
<mx:BarSeries xField="start" minField="duration"/>
</mx:series>
<mx:verticalAxis>
<mx:CategoryAxis categoryField="month" />
</mx:verticalAxis>
</mx:BarChart>
Vygo
  • Flex Charting Weirdness Update:11-30

    I'm trying to display a "Gantt Chart" type chart using Ely's example here: http://demo.quietlyscheming.com/ChartSampler/app.html (Series Types -> Columns & bars -> Floating Bars). This is really perfect for what I'm trying to do. I was

  • Save flex chart to server Update:10-11

    Hello All I am in need of your help in saving a flex chart on to the server. Basically I want to export the chart to excel, as I dont find any resource for Flash builder 4, SDK 3.5, I opted the option of 1. saving chart as image to server and 2. acce

  • Flex chart x-axis data spacing Update:10-11

    hello i am using flex chart line series and column series. i want to display 100 data points, with different dates along the x-axis, but i don't want all 100 points to be displayed at the same time as the x-axis dates will not be readable. i want to

  • Flex chart how to put distance between x-axis data Update:10-11

    hello i am using flex chart line series and column series. i want to display 100 data points, with different dates along the x-axis, but i don't want all 100 points to be displayed at the same time as the x-axis dates will not be readable. i want to

  • Flex chart x-axis spacing between data Update:10-11

    hello i am using flex chart line series and column series. i want to display 100 data points, with different dates along the x-axis, but i don't want all 100 points to be displayed at the same time as the x-axis dates will not be readable. i want to

  • Flex 3 to Flex 4 migration issue (Flex charting and Special char) Update:10-11

    Hi All, I have migrated Flex 3 to Flex 4 and in Flex charting axis label, I am not able to see less then sign ( < ). I tried to use <  but it's not working, I have attached sample code. <?xml version="1.0" encoding="utf-8"?>

  • Flex chart restarts on tab focus in firefox Update:11-30

    I have plotted flex chart inside div element. It shows up correctly but when i go to another tab in firefox and comes back then flex chart restarts. Also i have seen it happens inside dojo tabs also. Anyone has any idea why chart restarts ? How can t

  • Copy and Paste Flex chart to Word Document Update:11-30

    Hi , I'm a newbie to Flex and was wondering if anyone knows if it possible to use the right click button on the mouse to copy and paste a Flex chart to a Word Document? Any help would be greatly appreciated. thanksHi, Simply let a IE or FireFox windo

  • Convert/Export Flex chart to MS Word Update:11-30

    Hi All, Please let me know how to Convert/Export the Flex Chart to MS Word... Please send the related links or samples if  you have. Thanks in advance. Regards, Seshadri Babu.GWell, "used to..." is not a good business case. They don't need to re

  • Migrate Flex Chart to AS Update:11-30

    Hi, I've put together a simple test app that pulls data from blazeds and inserts the results in a PieChart defined in mxml. However when I try to create the same chart in AS the chart doesn't show up. I suspect that it is perhaps related to the seque