Posted At : August 14, 2007 8:08 AM | Posted By : Brendan Meutzner
Related Categories:
Flex Charting
So here's the code as I promised. There is still a minor bug I'm going to work out with the range drag to the extreme right, and will repost with updated code once fixed. But for now, enjoy.
When I'm trying to compile the source on my own using the Flex SDK I get the following errors:
(443) Error: Type was not found or was not a compile-time constant: DateTimeAxis. (563) Error: Type was not found or was not a compile-time constant: CartesianChart. (696) Error: Type was not found or was not a compile-time constant: CartesianChart.
Nice component, thanks. I changed the code to change the chart from a static width to a variable width. leftBox and rightBox do not resize correctly after the component is resized. What do you suggest to get that working correctly?
Sorry for the late reply. If you'll be resizing the component dynamically, just make sure you reset the ratio value that's used to calculate (on resize) the difference between the HDividedBox width and the length of your data array.... that should do the trick :-)
Yeah, bug fix is coming... sorry I haven't had a chance to get to it yet. Alternatively, if anyone else comes up with the fix in the meantime, feel free to share :-)
Its really a great work.. I was playing around with it and have increased the dataset to 10 years with only monthly breakup. By doing so, I found that its not correctly showing the axis also in many axis text is getting overlayed on each other. Please provide us guidance on this topic.
I have the charts.swc files in sdk folder ;after compilation the swf file is created and when I run it shows the following error: "error retrieving xml data" Directory structure of swf file is at same leve of data folder. What is missing?!!! can anybody give me suggestion. Thank you brendan for your excellent work.
What do you mean the axis is not displaying properly?
Yes, the items getting overlaid is an issue if you have a lot of data, but can be tweaked easily inside the custom renderer in order to reduce the number of labels displayed, or maybe rotating the text to fit more... it's really up to you on how to handle that.
Do you have any suggestions for using your "upgraded version" with less functionality - similar to the original chart you put it many months ago? I'm lookin to display data more simply, without all the financial perks (e.g. flagging dates, displaying dates, etc)...and I would like to just have the added functionality of the newer HSlider (it aligns better, you can pull the sides of the slider out without the data changing all the time, etc.).
I've been looking over the code but there's so many functions and variables that I can't seem to just remove the new HSlider and import it into your original graphing component.
Hey Brendan, this is an amazing tool...thanks so much for posting the code for it. I just had a quick question for you...when adding a legend with your code, I get an error associated with the custom item renderers for some reason...here is the error:
TypeError: Error #1034: Type Coercion failed: cannot convert mx.charts.chartClasses::LegendData@293db309 to mx.charts.ChartItem. at skins::ColumnSeriesCustomRenderer/set data() at mx.charts::LegendItem/set legendData() at mx.charts::Legend/::addLegendItem() at mx.charts::Legend/::populateFromArray() at mx.charts::Legend/mx.charts:Legend::commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/::validateProperties() at mx.managers::LayoutManager/::doPhasedInstantiation() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/::callLaterDispatcher2() at mx.core::UIComponent/::callLaterDispatcher()
Any idea of why that may be happening? I tried messing around with set data to figure it out in the renderer, but couldn't figure out what to do. If you have time to look into it, I'd really appreciate it. Thanks!
Hey Brendan, very nice bit of code indeed. Have you attempted to run this under Flex 3? I'm just debugging this error, though, I suspects its a Flex 3 issue. Any chance you could confirm?
TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.charts::AxisRenderer/private::measureTitle() at mx.charts::AxisRenderer/mx.charts:AxisRenderer::measure() at mx.core::UIComponent/private::measureSizes() at mx.core::UIComponent/validateSize() at mx.managers::LayoutManager/private::validateSize() at mx.managers::LayoutManager/private::doPhasedInstantiation() at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/private::callLaterDispatcher2() at mx.core::UIComponent/private::callLaterDispatcher() at [renderEvent]
Thanks for this code. This is tremendous. I have been working with the code for a few days now and I am having no luck getting my data to work with the code. I need to be able to plot hourly data instead of daily eg. <date>2006-07-08 12:00</date> any insights would be extremely helpful.
Good job, Brendan! I built the project with Flex Builder 3 and getting an error while mouse over the main area. Any comments? Thanks, Alex
vReferenceError: Error #1069: Property showRenderer not found on mx.core.UITextField and there is no default value. at ff2/getChartDataPoint()[/Users/alexvarshavsky/Documents/Flex Builder 3/ff2/src/ff2.mxml:651] at ff2/__mainChart_mouseMove()[/Users/alexvarshavsky/Documents/Flex Builder 3/ff2/src/ff2.mxml:48]
Sorry, I haven't had a chance to get the project ported into Flex 3 yet... I'd started the process back in late summer in early beta, but didn't get too much finished. It's on the list of things to do, but unfortunately further down the list right now ;-)
The error below seems to relate to the showRenderer method inside the custom line or column renderer (inside the skins folder i believe). showRenderer gets called on the children of the series, and i believe the ordering is different in the Flex3 components for chart series. I'd try debugging the app putting breakpoints where showRenderer is getting called on the mouseover events on the chart, and see if you can determine the children of the series that it's getting called on.
Hope that helps for now... let me know if you can't get it fixed (or if you can too!) and I'll have a look into it.
the charts you have developed are mind blowing. i an new to this blog and also to flex, so can you please help me how to download your code and run it.
Hi, regarding error : "vReferenceError: Error #1069: Property showRenderer not found on mx.core.UITextField and there is no default value. ". One such solution is to replace "mainChart.series[0].getChildAt(i + 1).showRenderer(false);" with "mainChart.series[0].getChildAt(i + 1).alpha = 0 ;" AND "mainChart.series[0].getChildAt(i + 1).showRenderer(true);" with "mainChart.series[0].getChildAt(i + 1).alpha = 1;"
I am also getting the same error message as polok, "error retrieving xml data" though swf file is created after compile. does any have had this issue please let me know
In the videos it was stated that writing a custom axis renderer would not be done but in the updated code a custom axis renderer was included. Good job guys. :-)
The chart you have developed is awesome. It works fine for me, I just have one more requirement which is dragging the chart’s data points and the whole series. I was able to do this for another charts, but not for this one, my code doesn't have any effect on the graph. Am I missing something here?
Regarding the "Error retrieving XML" issue, I just appended -use-network=false at the compiler arguments. Maybe there is sthing cleaner to fix this, but it works that way
(443) Error: Type was not found or was not a compile-time constant: DateTimeAxis.
(563) Error: Type was not found or was not a compile-time constant: CartesianChart.
(696) Error: Type was not found or was not a compile-time constant: CartesianChart.
Anybody having an idea what I'm missing?
Anyways, thanks for this great component!
Thanks.
Cyril
Sorry for the late reply. If you'll be resizing the component dynamically, just make sure you reset the ratio value that's used to calculate (on resize) the difference between the HDividedBox width and the length of your data array.... that should do the trick :-)
Really looking forward for that "extreme right" bug fix.
Thank you :)
Like, you want a period of 6 months from Now, and not a period of 6 months counting backward from the end date isn't it?
Thanks!
when you call moveSlider, just change the leftIndicator for rightIndicator, and instead of subtracting the number of days, just add them :)
Anyways, even in the original example, that "5d 1m 6m" control produces some unexpected results.
Anyways, it's allways a GREAT Help and I thank you again Brendan for making my day a lot easier!
I was playing around with it and have increased the dataset to 10 years with only monthly breakup. By doing so, I found that its not correctly showing the axis also in many axis text is getting overlayed on each other. Please provide us guidance on this topic.
"error retrieving xml data"
Directory structure of swf file is at same leve of data folder.
What is missing?!!! can anybody give me suggestion. Thank you brendan for your excellent work.
Yes, the items getting overlaid is an issue if you have a lot of data, but can be tweaked easily inside the custom renderer in order to reduce the number of labels displayed, or maybe rotating the text to fit more... it's really up to you on how to handle that.
I've been looking over the code but there's so many functions and variables that I can't seem to just remove the new HSlider and import it into your original graphing component.
Thanks!
TypeError: Error #1034: Type Coercion failed: cannot convert mx.charts.chartClasses::LegendData@293db309 to mx.charts.ChartItem.
at skins::ColumnSeriesCustomRenderer/set data()
at mx.charts::LegendItem/set legendData()
at mx.charts::Legend/::addLegendItem()
at mx.charts::Legend/::populateFromArray()
at mx.charts::Legend/mx.charts:Legend::commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/::validateProperties()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()
Any idea of why that may be happening? I tried messing around with set data to figure it out in the renderer, but couldn't figure out what to do. If you have time to look into it, I'd really appreciate it. Thanks!
I'm just debugging this error, though, I suspects its a Flex 3 issue. Any chance you could confirm?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts::AxisRenderer/private::measureTitle()
at mx.charts::AxisRenderer/mx.charts:AxisRenderer::measure()
at mx.core::UIComponent/private::measureSizes()
at mx.core::UIComponent/validateSize()
at mx.managers::LayoutManager/private::validateSize()
at mx.managers::LayoutManager/private::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/private::callLaterDispatcher2()
at mx.core::UIComponent/private::callLaterDispatcher()
at [renderEvent]
Thanks
i can't run it in flex 3.
thaks!!
I was just wondering how you can retrieve data from MySQL using php script instead of .xml. Could you help me with it ??
Thanks.
I built the project with Flex Builder 3 and getting an error while mouse over the main area.
Any comments? Thanks,
Alex
vReferenceError: Error #1069: Property showRenderer not found on mx.core.UITextField and there is no default value.
at ff2/getChartDataPoint()[/Users/alexvarshavsky/Documents/Flex Builder 3/ff2/src/ff2.mxml:651]
at ff2/__mainChart_mouseMove()[/Users/alexvarshavsky/Documents/Flex Builder 3/ff2/src/ff2.mxml:48]
The error below seems to relate to the showRenderer method inside the custom line or column renderer (inside the skins folder i believe). showRenderer gets called on the children of the series, and i believe the ordering is different in the Flex3 components for chart series. I'd try debugging the app putting breakpoints where showRenderer is getting called on the mouseover events on the chart, and see if you can determine the children of the series that it's getting called on.
Hope that helps for now... let me know if you can't get it fixed (or if you can too!) and I'll have a look into it.
[Style] must annotate a class.
And it goes to the FillStyles.as file
Any ideas?
the charts you have developed are mind blowing. i an new to this blog and also to flex, so can you please help me how to download your code and run it.
On "Google Finance " can add synbol, it can compare symbols. But in demo only a symbol. Brendan help ...
could you give an example to generate the swf, like the code or script that use to run this library
Thanks
great example. To Alex's problem (Error #1069: Property showRenderer not found on mx.core.UITextField and there is no default value.):
If you remove the custom method showRenderer in skins/LineSeriesCustomRenderer the error disappears for me.
regarding error : "vReferenceError: Error #1069: Property showRenderer not found on mx.core.UITextField and there is no default value.
".
One such solution is to replace
"mainChart.series[0].getChildAt(i + 1).showRenderer(false);"
with
"mainChart.series[0].getChildAt(i + 1).alpha = 0 ;"
AND
"mainChart.series[0].getChildAt(i + 1).showRenderer(true);"
with
"mainChart.series[0].getChildAt(i + 1).alpha = 1;"
"error retrieving xml data"
though swf file is created after compile. does any have had this issue please let me know
horizontalAxisRenderer to horizontalAxisRenderer
and
verticalAxisRenderer to verticalAxisRenderers
The chart you have developed is awesome. It works fine for me, I just have one more requirement which is dragging the chart’s data points and the whole series. I was able to do this for another charts, but not for this one, my code doesn't have any effect on the graph. Am I missing something here?