Flex Charting Weirdness
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.
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
Similar Messages
-
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. accessing that image file in my excel
Any sample codes should be very helpful, as this is quite urgent. Thanks!The problem was, that it is not possible to see the pdf directly from transaction AL11.
I used the transaction CG3Y to move the file from the server to my desktop, and there I can see the pdf file.
Solved
Thanks for the input. -
Flex chart x-axis data spacing
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 have a fixed space
between each x-axis point and the user then scrolls along the
chart.
i read the API but do not see any way to add the x-axis
spacing?
also how i do put more data information, with each data point
if a mouse if placed over it, not just the X & Y data points.
thank you for any assistance.
Tonythanks so much,
The tip data solved my 2nd problem.
Thanks for your suggestions to"
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 have a fixed space
between each x-axis point and the user then scrolls along the
chart.
i read the API but do not see any way to add the x-axis
spacing?
you mentioned about using min/max values on the x-axis. That
is a good solution except i would then need to add buttons to say
,show the next 30 days.
I really want to to show 90days of data data, with say 30
days appearing at once, and the user just scrolls to see the rest
of the days data without having to press buttons for more data. Any
idea how i can do this?
thanks
Anthony -
Flex chart how to put distance between x-axis data
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 have a fixed space
between each x-axis point and the user then scrolls along the
chart.
i read the API but do not see any way to add the x-axis
spacing?
thank you for any assistance.
TonyI don't know what you mean then.
If you set the min and max to be a certain number of days
apart then you know the dates within those days will be displayed.
That combined with the width of the chart will define how much
space there is between x-axis points. -
Flex chart x-axis spacing between data
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 have a fixed space
between each x-axis point and the user then scrolls along the
chart.
i read the API but do not see any way to add the x-axis
spacing?
also how i do put more data information, with each data point
if a mouse if placed over it, not just the X & Y data points.
thank you for any assistance.
Tonythanks so much,
The tip data solved my 2nd problem.
Thanks for your suggestions to"
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 have a fixed space
between each x-axis point and the user then scrolls along the
chart.
i read the API but do not see any way to add the x-axis
spacing?
you mentioned about using min/max values on the x-axis. That
is a good solution except i would then need to add buttons to say
,show the next 30 days.
I really want to to show 90days of data data, with say 30
days appearing at once, and the user just scrolls to see the rest
of the days data without having to press buttons for more data. Any
idea how i can do this?
thanks
Anthony -
Flex 3 to Flex 4 migration issue (Flex charting and Special char)
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"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600" initialize="init()">
<fx:Declarations>
<s:SolidColor id="s1" color="#738994"/>
<mx:SeriesInterpolate id="seriesInterpolate" duration="800"/>
<mx:SeriesSlide id="seriesSlide" duration="800" direction="up"/>
<mx:SeriesZoom id="seriesZoom"
duration="1000"
minimumElementDuration="50"
elementOffset="50"
verticalFocus="top"
horizontalFocus="left"
relativeTo="chart"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var student:ArrayCollection = new ArrayCollection([
{Stream: "Management", Girls:1000, Boys:1400, TotalStudent:2400},
{Stream: "<Computer Science", Girls:800, Boys:1200, TotalStudent:2000},
{Stream: "< Mechanical", Girls:200, Boys:1500, TotalStudent:1700},
{Stream: "> Electical", Girls:800, Boys:850, TotalStudent:1650},
{Stream: "Electronics", Girls:500, Boys:1000, TotalStudent:1500},
{Stream: "Civil", Girls:300, Boys:900, TotalStudent:1200}
private function update():void {
var str:String = catfDP.selectedItem.data;
if(str == "Girls"){
cs1.yField = str;
cs1.displayName = str;
cs1.setStyle("fill" , "738994");
}else if(str == "Boys"){
cs1.yField = str;
cs1.displayName = str;
cs1.setStyle("fill" , "999990");
}else{
cs1.yField = str;
cs1.displayName = str;
cs1.setStyle("fill" , "406374");
private function init():void{
catfDP.selectedIndex= 0;
effectDP.selectedIndex= 0;
]]>
</fx:Script>
<s:Panel title="Chart Effect Example" width="627" height="565">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<mx:ApplicationControlBar dock="true" width="625" height="82">
<mx:Form>
<mx:FormItem label="Category Field:">
<s:DropDownList id="catfDP" change="update();" prompt="--Select--" width="136"
height="19">
<s:dataProvider>
<mx:ArrayList>
<fx:Object data="Girls" label="Girls" />
<fx:Object data="Boys" label="Boys" />
<fx:Object data="TotalStudent" label="TotalStudent" />
</mx:ArrayList>
</s:dataProvider>
</s:DropDownList>
</mx:FormItem>
<mx:FormItem label="Choose Chart Effect:">
<s:DropDownList id="effectDP" change="update();" width="136" prompt="--Select--">
<s:dataProvider>
<mx:ArrayList>
<fx:Object label="seriesInterpolate" data="{seriesInterpolate}" />
<fx:Object label="seriesSlide" data="{seriesSlide}" />
<fx:Object label="seriesZoom" data="{seriesZoom}" />
</mx:ArrayList>
</s:dataProvider>
</s:DropDownList>
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:ColumnChart id="cchart"
dataProvider="{student}"
showDataTips="true"
width="621"
fontFamily="verdana" height="402">
<mx:verticalAxis>
<mx:LinearAxis title="Number of Students" />
</mx:verticalAxis>
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{student}"
categoryField="Stream"
title="Stream"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries id="cs1"
xField="Stream"
yField="Girls"
displayName="Girls"
fill="{s1}"
showDataEffect="{effectDP.selectedItem.data}"/>
</mx:series>
</mx:ColumnChart>
<s:HGroup>
<mx:Legend dataProvider="{cchart}"
direction="horizontal"/>
<s:VGroup>
</s:VGroup>
</s:HGroup>
</s:Panel>
</s:Application>Thank you very much for you answer.
I have solved this problem using Itemrenderer.
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoDrawBackground="true">
<mx:Label htmlText="{data.text}"/>
</s:ItemRenderer>
and in chart I have used labelRenderer. in label I have used < for ( < ) sign.
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{expenses}"
categoryField="Month"
title="FY 2006"
id="a1"
/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer labelRotation="45" axis="{a1}" labelRenderer="chase.BarChartLabelRenderer"/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer labelRotation="45" axis="{a1}" labelRenderer="chase.BarChartLabelRenderer"/>
</mx:verticalAxisRenderers> -
Flex chart restarts on tab focus in firefox
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 this be avoided.
Thanks,
ZoozThe author of Custom New Tab says this will be in the next update of the extension.
If you don't want to wait for the approval cycle on the Add-ons site, you can grab it from the Versions page:
https://addons.mozilla.org/firefox/addon/custom-new-tab/versions/
<s>Note: I have not tested it myself.</s>
<u>Version 1.9 worked for me. See screenshot regarding how the Options dialog works for the updated extension.</u> -
Copy and Paste Flex chart to Word Document
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 window display your Flex chart,
and hold [Alt] and press [PrtSc] in your keyboard, Then, paste it
into Word or Paint to be edited.
Have fun!
Jeffrey -
Convert/Export Flex chart to MS Word
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 receive reports anymore, they can view them in the portal as needed. Viewing in Word is functionaly about the same as viewing in Excel if "receiving" is the preferred method for them.
Having reports in PDF is better if they want to print.
Or they can use Crystal reports as a last resort.... I think those might export to word.
Webi is on-demand, ad-hock reporting, that's what's it for. Export to other formats is a secondary function. -
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 sequence of how things are initialized? but I'm not sure
Here is my code. I've created 3 charts. The first (mxml) chart is the one that works fine. The second (AS) is my attempt to recreate the mxml chart in AS and it does not work. The third is a sanity check of another test AS chart just to see if I can actually make an AS PieChart and it also works fine.
If anyone has any insight it would be much appreciated.
Thank you,
Kaveh
<?xml version="1.0" encoding="utf-8"?>
<!-- intro\intro_remoting.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:data="com.kg.data.*"
width="100%"
height="100%"
initialize="getPokerParameterNumbers()"
backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.charts.PieChart;
import mx.charts.series.PieSeries;
import mx.charts.Legend;
[Bindable]
public var paramCount:ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Expense:"Taxes", Amount:2000},
{Expense:"Rent", Amount:1000},
{Expense:"Bills", Amount:100},
{Expense:"Car", Amount:450},
{Expense:"Gas", Amount:100},
{Expense:"Food", Amount:200}
// Get the initial data set from the poker db
private function getPokerParameterNumbers():void {
//remoteObject.getParameterTypesAndCount();
remoteObject.getParameterCount();
addSecondChart();
add3rdChart();
// Handle the recevied message.
private function resultHandler(event:ResultEvent):void {
statusTextArea.text += "Server responded [] : \n";
var myObject:Object = event.result;
paramCount.removeAll();
for (var key:* in myObject)
var value:* = myObject[key];
statusTextArea.text += "Parameter: " + key + " Count: " + value + "\n";
var paramItem:Object = new Object();
paramItem.parameterization = key;
paramItem.count = value;
paramCount.addItem(paramItem);
paramCount.refresh();
private function newResultHandler(event:ResultEvent):void {
var collectionResult:ArrayCollection = ArrayCollection(event.result);
statusTextArea.text += "-" + collectionResult.length + "-";
paramCount = ArrayCollection(event.result);
// Handle a message fault.
private function faultHandler(event:FaultEvent):void {
statusTextArea.text += "Received fault: " + event.fault + "\n";
public function addSecondChart():void {
//var medalsAC:ArrayCollection;
var chart:PieChart;
var series:PieSeries;
//medalsAC = getDataProvider();
/* Define pie series. */
series = new PieSeries();
//series.nameField = "label";
//series.field = "data";
series.nameField = "name";
series.field = "count";
/* Remove default dropshadow filter. */
series.filters = [];
/* Define pie chart. */
chart = new PieChart();
chart.percentWidth = 100;
chart.percentHeight = 100;
chart.showDataTips = true;
//chart.dataProvider = medalsAC;
chart.dataProvider = paramCount;
chart.series = [series];
/* Add chart to the display list. */
topHBox.addChild(chart);
private function add3rdChart():void {
var medalsAC:ArrayCollection;
var chart:PieChart;
var series:PieSeries;
medalsAC = getDataProvider();
/* Define pie series. */
series = new PieSeries();
series.nameField = "label";
series.field = "data";
/* Remove default dropshadow filter. */
series.filters = [];
/* Define pie chart. */
chart = new PieChart();
chart.percentWidth = 100;
chart.percentHeight = 100;
chart.showDataTips = true;
chart.dataProvider = medalsAC;
chart.series = [series];
/* Add chart to the display list. */
p1.addChild(chart);
* Create and return a simple ArrayCollection to
* use as a data provider.
private function getDataProvider():ArrayCollection {
var arr:Array = [];
arr.push({label:"Product 1", data:3});
arr.push({label:"Product 2", data:1});
arr.push({label:"Product 3", data:4});
arr.push({label:"Product 4", data:1});
arr.push({label:"Product 5", data:5});
arr.push({label:"Product 6", data:9});
return new ArrayCollection(arr);
]]>
</mx:Script>
<mx:RemoteObject id="remoteObject"
destination="pokerDataSource"
result="newResultHandler(event);"
fault="faultHandler(event);"/>
<mx:HBox width="100%" id="topHBox">
<mx:VBox>
<mx:PieChart id="myChart"
dataProvider="{paramCount}"
showDataTips="true"
selectionMode="single"
itemRollOverColor="#FF0066">
<mx:series>
<mx:PieSeries
field="count"
nameField="name"
labelPosition="callout"
/>
</mx:series>
</mx:PieChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:VBox>
<mx:TextArea id="statusTextArea"
width="100%"
height="100%"
backgroundAlpha="0"
focusAlpha="0"
selectable="false"/>
</mx:HBox>
<mx:Panel id="p1"/>
</mx:Application>Hi,
Simply let a IE or FireFox window display your Flex chart,
and hold [Alt] and press [PrtSc] in your keyboard, Then, paste it
into Word or Paint to be edited.
Have fun!
Jeffrey -
How can I export an flex chart to excel? Does anyone have any sample code.
Yes, now it's easy with AIR2 (and AS3XLS):
http://coenraets.org/blog/2009/11/open-in-excel-another-air-2-mini-sample/
Thanks,
Oleg. -
Hello
I would like to create a horizontal bar chart according to data from a struts2 action class and place the flex chart in a jsp.
I have already seen code on how to do a horizontal bar chart @ http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=charts_types_109_03.html
I am watching James Ward's video on java and flex @ http://www.jamesward.com/blog/2008/07/21/video-flex-and-java/
How do I place the flex graph in my jsp? What kind of flex project/component do I create and where do I place it?
Appreciate all help.
ThanksOnce you compile your Flex app you can size it and embed it anywhere you
want in your web page. -
I have recently purchased Flex Charting and added the serial
number to the License Management section in Flex Builder 2 and now
all of my charts that I have created previously are not displaying
at all. I am getting an error telling me this
"Severity Description Resource In Folder Location Creation
Time Id
1 Design mode: Error creating item ColumnChart in parent
Canvas "Mortgage Calculator". Please choose Design > Refresh to
refresh design mode. ProductDetails.mxml flexstore/productsView
January 11, 2007 10:59:59 AM 2328"
However the "refresh" option does nothing to solve the
problem. Any idea what is wrong?What is the result format you're setting on your HTTPService
request?
"alice_data" <[email protected]> wrote in
message
news:g6novb$gpl$[email protected]..
> Hi,
>
> I am wondering if anyone has tried to extract some
information from the
> database and make attempts of plotting it using Flex
Charting. My code is
> in
> the following, and the database output brings back all
the results I
> desired,
> but when I run the script, I was given the following
error:
>
> ReferenceError: Error #1069: Property theta not found on
> mx.rpc.http.mxml.HTTPService and there is no default
value.
This suggests that your HTTPService result is coming back in
a format where
you can't just get the properties off of it. You may need to
set the result
format to e4x, and since it is rss you may need to use one or
more
namespaces.
HTH;
Amy -
Flex Charting - Generating PDF and Images
Is there any way with Flex Charting (or some 3rd party tool
integrated with Flex) to output a FlexChart as a PDF or an image
for inclusion in a report?Yes there is.
Adobe® LiveCycle® Data Services ES
Developer’s Guide (PDF)
lcds_dev_guide.pdf
Chapter 17
Page 275
import mx.graphics.ImageSnapshot;
[Bindable]
public var balanceSheetImage:String;
private function generatePDF():void {
var snapshot:ImageSnapshot =
ImageSnapshot.captureImage(balanceSheet);
balanceSheetImage =
ImageSnapshot.encodeImageAsBase64(snapshot);
snapshot = ImageSnapshot.captureImage(earnings);
earningsImage = ImageSnapshot.encodeImageAsBase64(snapshot); -
Flex Charts: Will they improve?
Hello!
I'm trying to make some minimalistic charts for some ultimate PDF business plans and annual reports. I did them in Illustrator first, but Illustrator's graph tool hasn't been developed on since 1996, and it was a real pain to update my charts as the numbers changed. With Flex though, I can just generate charts based on XML that I output from my business models in OpenOffice. Plus they look real good and are interactive.
It seems though, that everyone I talk to say that Flex Charts suck. That they were made by people who didn't follow standards. Personally I love Flex Charts, although I'm not a big fan of having a lot of "Wait for improved CSS support", "Should be CSS" etc. comments in my code:
https://gist.github.com/1623621
https://gist.github.com/1623625
https://gist.github.com/1623628
Does anybody know if this is about to change? Are there any new Flex charting libraries in the making?
--Dwayne
P.S. If you can, please forward this post to as many Flex developers as you can.Flex is now an Apache project (http://incubator.apache.org/flex/) and the future of the charting components will be determined by the open-source community there. However, I think Adobe may contribute some unreleased work that it has done towards a Spark version of the charting components.
Gordon Smith, Adobe
Maybe you are looking for
-
The error console suggests that there is a missing semicolon in the code. It's unclear whether this is in the Firefox code or the Java script code, or for that matter whether it's the source of the problem. In any event the only way both times I have
-
Please read subject first then continue with this text: Then I tried to connect my IPAD and IPHONE and neither would update because it couldnt find the file or something and then i couldnt even restore. The next day itunes was gone completely: "The i
-
Calling secured web service, cross domain security
Hey all, I am trying to call a secured service, for which i need to enable cross domain security. I have followed the steps described in http://download.oracle.com/docs/cd/E15523_01/web.1111/e13707/domain.htm#i1176046 i.e. enabling trust between webl
-
I just cant successfully open some PDF files(preview default) occasionally on the new Macbook Air, left with all blank contents, whereas, there is no problem in other PCs, I have no idea at all, need solutions ASAP, thanks.
-
Where DTP requests will be stored
Hi , I know Infopackge requests stored in table RSLDTDONE . But I want the table where DTP Reqeusts will be stored . Please anybody can help