External XML data for plot chart
Hi,
Can you provide the XML equivalent & the corresponding changes to be done in the below plot chart code :
<?xml version="1.0"?>
<!-- charts/BasicPlot.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"January", Profit:2000, Expenses:1500, Amount:450},
{Month:"February", Profit:1000, Expenses:200, Amount:600},
{Month:"March", Profit:1500, Expenses:500, Amount:300},
{Month:"April", Profit:500, Expenses:300, Amount:500},
{Month:"May", Profit:1000, Expenses:450, Amount:250},
{Month:"June", Profit:2000, Expenses:500, Amount:700}
]]></mx:Script>
<mx:Panel title="Plot Chart">
<mx:PlotChart id="myChart" dataProvider="{expenses}"
showDataTips="true">
<mx:series>
<mx:PlotSeries
xField="Expenses"
yField="Profit"
displayName="Plot 1"
/>
<mx:PlotSeries
xField="Amount"
yField="Expenses"
displayName="Plot 2"
/>
<mx:PlotSeries
xField="Profit"
yField="Amount"
displayName="Plot 3"
/>
</mx:series>
</mx:PlotChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</mx:Application>
This does what you want.
If this post answers your question or helps, please mark it as such.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
[Bindable] public var expenses:XMLListCollection;
private function init():void{
expenses = new XMLListCollection(XMLList(xml..dataItem));
private var xml:XML =
<data>
<dataItem>
<Month>January</Month>
<Profit>2000</Profit>
<Expenses>1500</Expenses>
<Amount>450</Amount>
</dataItem>
<dataItem>
<Month>February</Month>
<Profit>1000</Profit>
<Expenses>200</Expenses>
<Amount>600</Amount>
</dataItem>
<dataItem>
<Month>March</Month>
<Profit>1500</Profit>
<Expenses>500</Expenses>
<Amount>300</Amount>
</dataItem>
<dataItem>
<Month>April</Month>
<Profit>500</Profit>
<Expenses>300</Expenses>
<Amount>500</Amount>
</dataItem>
<dataItem>
<Month>May</Month>
<Profit>1000</Profit>
<Expenses>450</Expenses>
<Amount>250</Amount>
</dataItem>
<dataItem>
<Month>June</Month>
<Profit>2000</Profit>
<Expenses>500</Expenses>
<Amount>700</Amount>
</dataItem>
</data>;
]]></mx:Script>
<mx:Panel title="Plot Chart">
<mx:PlotChart id="myChart" dataProvider="{expenses}"
showDataTips="true">
<mx:series>
<mx:PlotSeries
xField="Expenses"
yField="Profit"
displayName="Plot 1"
/>
<mx:PlotSeries
xField="Amount"
yField="Expenses"
displayName="Plot 2"
/>
<mx:PlotSeries
xField="Profit"
yField="Amount"
displayName="Plot 3"
/>
</mx:series>
</mx:PlotChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
</mx:Application>
Similar Messages
-
External XML data for more charts in a single page
I am using a plot chart which gets data from an external XML file through <mx:HTTPService>
I create another chart in the same page which also gets data from another XML file.
How can i provide data to this chart through the HTTP Service ?
- SenI hope i've understood well what you want to do.
Easily you could define 2 different httpservice with different url and bind them to chart.
hope this help!
bye! -
External XML data files to add values to drop down lists
I would like to have external XML data files to add values to drop down lists in my form.. But when i create a data connection it is working properly only in the Preview in Livecycle Designer.. but not in the PDF form(Adobe Reader). Moreover im not sure whether it will work in the form manager..!plzz help me!
Raghava Kumar V.S.S.Hi,
For the case of raghavakumar, Is it really that I need to have LiveCycle Reader Extensions? Is there any other way that could do the same?
Thank you -
Dynamic Series creation for Plot Chart
Hi,
I am using a plot chart which takes data from an external XML file.
Based on certain fields in the data, I create 3 different plot series.
I use a Combo box to show different plot series based on the selected value from it.
I am placing another Combo box
How can do the below task:
I need to create some dynamic series based on some node elements in the series for which the chart is currently shown.
I create another Combo box to show the above generated plot series based on the selected value from it.Hi,
I am using a plot chart which takes data from an external XML file.
Based on certain fields in the data, I create 3 different plot series.
I use a Combo box to show different plot series based on the selected value from it.
I am placing another Combo box
How can do the below task:
I need to create some dynamic series based on some node elements in the series for which the chart is currently shown.
I create another Combo box to show the above generated plot series based on the selected value from it. -
DataTip box to appear near the plot for Plot Chart
Hi,
I am using a Plot chart.
I use three Plot series for the chart.
I show the plots for one series at a time.
When I show the Data tips for each plot, I am getting a long line connecting the plot & the DataTip (as shown in attachment).
I would like the DataTip box to appear near the plot.
How to accomplish this ?
- SenThe bottom line is that it does not work reliably, Tim.
I had occasion to scan old Kodachrome slides (2x2" in cardboard mount), and placed identifying markers with "Talk Bubbles."
Open your picture file
Access the Custom Shape Tool (U). On the tool's option bar at the top next to "Shapes", click on the arrow and find the "Talk Bubbles" library. In that there are several shapes which you can drag into position. The shapes fill with the foreground color (see chips, lower left of work-space)
Next, use the Type tool for the name.
Note that you can position the shape and the name with the move tool, and resize with the corner handles of the bounding box -- the advantage of doing things in layers. -
Loading external XML data into XMLObject
hey all,
i've been working on a basic fl2 app that generates a list of
posts from an external XML file located on my server
(www.omedia.mobi/forum.xml) The swf file is also located there in
the same directory .(crime.swf).
The app runs fine in the emulator, both when i tried to load
the data locally on my mac, and when i load it from the server. But
when i put the swf file on my N70, it fails to load the data.
I'm banging my head against a wall trying to get this sorted.
has anyone had any similar experiences?
any help would be apprieciated...
many thanks
MattMatt–
Dumb question, are you 100% sure that your phone is making
any connection to the internet? Does your phone read a name/value
variable from an external file?
I just build a file to test this (It won't work
online—it will only work on a phone.):
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.swf
The FLA is also up:
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.fla
Also, you can check out:
http://www.adobe.com/devnet/devices/articles/flashlite11_rss.html
quote:
//Some of the code from the FLA:
canLoad = _capLoadData;
if (canLoad == 1) {
urlPath = "
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.txt";
loadVariables(urlPath, _root);
} else {
connection = "client does not support loading dynamic data";
// where "connection" is the variable name of the text field
If the connection is present, then I think I know what is
wrong. Let me know. -
This is the continuation of "Filter ListBox w/ XML Data using a TextBox"
Andy, I read your paper last night. You are so high that I can only understand some of it right now, but you do bring up a performance issue, which needs to be considered for this thread.
Is myListBox.Items a view or the items that have already loaded into the myListBox? I am confused. If myListBox.Items are the items that are currently in the myListBox, then there will be an performance issue if there are a huge amount of items in the myListBox.
Am I right?
Then, the process supposed to be:
1, add XML source to Blend
2, filter the source
3, put in the listbox
Then the code will be much complicated than the 1st one. right?
private void filterBtn_Click(object sender, RoutedEventArgs e)
myListBox.Items.Filter = target => ((XmlElement)target)["ID"].InnerText.Contains(myTextBox.Text);There's a pattern that almost every wpf dveloper uses and it's called mvvm.
Google it, there'll be a shed load of articles.
It's a passive view pattern in that the view has minimal logic in it.
The view is your window ( or usercontrol).
You can add a listboxitem to the listbox.items collection but i would only do that if it's a very simple static collection.
You can bind a collection to itemssource and the listbox will create a listboxitem for each things it gets from that collection.
It creates them using a datatemplate.
When you do that binding apparently directly to a collection a collectionvie is automagically created between control and collection.
You can explicitly create one of those collectionview things yourself and this is agreat way to filter and sort.
You can also use one of those collectionviews to navigate the collection setting the current item in the viewmodel.
That can be synced in the view so you select an item from the viewmodel.
I think I probably drifted off topic there somewhat.
Mvvm is probably different from stuff you've done before.
It's easier to do a bunch of things using mvvm plus it's what any prospective employer will want.
Along with tdd/bdd it's industry standard.
Big tip: learn it.
You want to avoid showing a user a huge load of data. Not so much for performance reasons but because users can only cope with so much data at a time.
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
How to provide different plor series for plot chart
How to provide different plot series for a Plot Chart.
The IDs of the series are given in a ComboBox controlSeries are stored in an array. If there is only one series, then you can change it simply by "pushing" a series into a new array, and then assigning that series array to the chart. If you are replacing one series in the chart series array, then you have to figure out which to remove and put the new one in.
This LiveDocs link may help:
http://livedocs.adobe.com/flex/3/html/help.html?content=charts_intro_7.html
If this post answers your question or helps, please mark it as such. -
Form with dropdown lists using external XML data - Distribution
Hi all,
I have created a form which has a series of drop down lists that populate dynamically from an external XML file. The option selected in the first list determines what data can be selected in the second, and so on.
This functionality worked well within designer when I previewed the form - the problem I have is when I go to distribute. I (perhaps mistakenly) assumed that when I distributed the form, the external XML file would be absorbed into the main PDF, but this as not the case. Not only that, even if the XML file is in the same location as the published PDF, the dropdowns no longer populate with any data.
Am I doing something wrong? Is there a setting to draw in external XML when a form is published? Is there another method to dynamically populate dropdowns that will provide me with a single PDF as a final product?
Cheers,
Lachlan.Hello Lachlan,
Before distributing the form have you opened that form in Acrobat and imported the XML and saved it ?
Thanks.
Bibhu. -
Problems handling xml data for tree control.
Hi,
I have tried using tree control for displaying my xml data
but I had a problem that i did not have labels in my xml data. A
sample xml data is attached. So it displays the whole data at each
level in the tree. The root label will be the entire the xml data
and then one level down the remaining xml data and so on...
How do i solve this issue i,e get the tags names itself as
labels..
Thanks in advance....An update after some efforts..
Could get the folders perfectly i.e until the level of
CPUTime perfectly but could not get the leaf: 32 since i used the
following to set the label.
I would like to know if there is a way to find out if a node
is a leaf or folder and according set the label -
Filter XML Data for Text Fields.
Hi,
I'm trying to display a single record out of an XML database
into dynamic fields in my MovieClip. I need to be able return a
single record based on the current time. Attached is a sample of my
XML data.
I was wondering if this could be acheived with a DataSet
filterFunction? If it is possible, what code would I need to
include?
Finally, do I need to pass my full DataSet to an array or do
I need to filter first & then pass to an array?
Thankyou.
Elton Bernardson.There's a pattern that almost every wpf dveloper uses and it's called mvvm.
Google it, there'll be a shed load of articles.
It's a passive view pattern in that the view has minimal logic in it.
The view is your window ( or usercontrol).
You can add a listboxitem to the listbox.items collection but i would only do that if it's a very simple static collection.
You can bind a collection to itemssource and the listbox will create a listboxitem for each things it gets from that collection.
It creates them using a datatemplate.
When you do that binding apparently directly to a collection a collectionvie is automagically created between control and collection.
You can explicitly create one of those collectionview things yourself and this is agreat way to filter and sort.
You can also use one of those collectionviews to navigate the collection setting the current item in the viewmodel.
That can be synced in the view so you select an item from the viewmodel.
I think I probably drifted off topic there somewhat.
Mvvm is probably different from stuff you've done before.
It's easier to do a bunch of things using mvvm plus it's what any prospective employer will want.
Along with tdd/bdd it's industry standard.
Big tip: learn it.
You want to avoid showing a user a huge load of data. Not so much for performance reasons but because users can only cope with so much data at a time.
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
Hi
I am try to see if there are any blanks in a node of a table that has xml data in one of the columns. The query I use is returning zero results. Any suggestions?
Select COUNT(*)from ENTITY
Where CONVERT(XML, Ent_root_xml, 0 ).value('(//UD_PQ_FLAG/node())[1]', 'VARCHAR(50)')= ' 'This is a little tricky. When you don't use /text(), looking for space is the right thing. But when you use /text() you should look for NULL:
DECLARE @x TABLE (id int NOT NULL, x xml NOT NULL)
INSERT @x (id, x)
VALUES (1, '<ROOT><Node>This node is intentionally not left blank.</Node></ROOT>'),
(2, '<ROOT><Node></Node></ROOT>')
SELECT id
FROM @x
CROSS APPLY x.nodes('/ROOT') AS T(x)
WHERE T.x.value('(Node/text())[1]', 'varchar(23)') IS NULL
SELECT id
FROM @x
CROSS APPLY x.nodes('/ROOT') AS T(x)
WHERE T.x.value('Node[1]', 'varchar(23)') = ' '
Erland Sommarskog, SQL Server MVP, [email protected] -
Preformatted RTF string in XML data for BI Publisher merge
Hi
I have been presented to the question: Can we send a preformatted RTF text as one of the input fields in XML stream to BI Publisher (mail)merge?
We're using the MS Word plugin to create a RTF template. Effectively we want to merge RTF text using RTF template.
I cannot find any documentation stating that it is supported. My tests locally in the MS Word plugin are'nt exactly sucessfull, but there is a number of possible reasons for that.. :-)
Does anybody know explicitly if it is supported (or not)?
Regards
/JohnHi..
Obviously the buffer size need to be extend...also its look like you are customizing the report ..so it would be better if you check for data redundancy once.
you have to increase the size of buffer ....and then let it completly open the xml output file...till its done and then save it and use for preview.
You have to ask your dba to increase the buffer ...or from sysadmin --->conc manager--->output post processing ...check for the manager and increase the buffer size as well.
Thanks
Ratnesh -
XML data for Spry Menu ?
I maintain several web sites with static pages that all carry
a common Spry menu bar hard coded into each page via a template.
How can I use an XML file to feed a Spry menu widget to save
uploading all the pages every time there is a change on the site
that requires the menu to be updated?
I've searched the web and help files for an answer to this
without success, so any help or pointers would be most appreciated.I made this example that uses a xml file to build the spry
menu, the page is html, you need to make a seperate dataset for
each <ul> tag, or item group in the menu, notice the two
datasets in my sample, you could expand and make as many as you
want, all drawn from xml files. check out the page here:
http://gohbcc.com/examples/menutest.html
html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryMenuBar.js"
type="text/javascript"></script>
<script src="SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryData.js"
type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("s.xml", "links/link");
var ds2 = new Spry.Data.XMLDataSet("t.xml", "links/link");
//-->
</script>
</head>
<body>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a class="MenuBarItemSubmenu" href="#">Item
1</a>
<ul>
<div spry:region="ds1">
<li spry:repeat="ds1">
<a href="{a/@href}">{a}</a>
</li>
</div>
<li><a href="#">Item 1.1</a></li>
<li><a href="#">Item 1.2</a></li>
<li><a href="#">Item 1.3</a></li>
</ul>
</li>
<li><a href="#">Item 2</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Item
3</a>
<ul>
<div spry:region="ds2">
<li spry:repeat="ds2">
<a href="{a/@href}">{a}</a>
</li>
</div>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
</ul>
<p> </p>
<div spry:region="ds1" style="float:right;">
<table>
<tr>
<th>A</th>
<th>A/@href</th>
</tr>
<tr spry:repeat="ds1">
<td>{a}</td>
<td>{a/@href}</td>
</tr>
</table>
</div>
<p> </p>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1",
{imgDown:"SpryAssets/SpryMenuBarDownHover.gif",
imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
XML Files
t.xml;
<?xml version="1.0" encoding="utf-8"?>
<links>
<link><a
href='customer_enter.php?method=Fname'>First
Name</a></link>
<link><a
href='customer_enter.php?method=caseNum'>Case
Number</a></link>
<link><a
href='customer_enter.php?method=Lname'>Last
Name</a></link>
<link><a
href='customer_enter.php?method=caseWorker'>Case
Worker</a></link>
</links>
s.xml:
<?xml version="1.0" encoding="utf-8"?>
<links>
<link><a href='customer_find.php?method=name'>By
Name</a></link>
<link><a
href='customer_find.php?method=caseNum'>By Case
Number</a></link>
<link><a href='customer_find.php?method=date'>By
Date</a></link>
<link><a
href='customer_find.php?method=itemNum'>By Item
Number</a></link>
</links> -
Been some time since I have used Flash for anything...
I'm working on a little project to dynamically build a map
and set points of interest on the map. At this time I have the
(mySQL) data being queried and formatted with PHP and pushing the
data to Flash as XML.
In starting the project I'm a bit lost... I mean I have my
data and a good XML format but as it is I'm lost on parsing the
data in Flash and assigning its values to movie clips or other...
I've looked at the Loader Component and the XML Connector
Component and find I can get that to work at all...
My second though was to create a single movie clip on stage
and give it an instance name of "Background" and have it load the
URL of an image given in the attached XML doc... Node "a_zone" and
the value given to attribute "image"... But this brings me back to
square one of not quite understanding Flash and parsing XML... With
this second idea I would use AS to create a movie clip, set it's X
& Y cords and load an image to it based on the XML attributes
listed in the "Gatherable" node (one for each node).
Any suggestions, examples or related info is welcome...
Thanks in advance!Okay, that really wasn't what I was looking for... But I did
go back and RTM :-)
Here's what I have... 1st frame:
2nd Layer: movieclip with the instance name "currentPicture"
The image loads into "currentPicture" from the URL given in
the XML "a_zone" node attribute "image" just fine....
But I'm not able to grab the attributes of each "Gatherable"
node it seems... am I missing something or just not pointing to the
right node?
I keep getting:
undefined
undefined
undefined
Error opening URL
"file:///C|/apache2triad/htdocs/gatherer/flash/undefined"
Error opening URL
"file:///C|/apache2triad/htdocs/gatherer/flash/undefined"
Error opening URL
"file:///C|/apache2triad/htdocs/gatherer/flash/undefined"
Maybe you are looking for
-
I want to put a fade in on the clips in my video, but I do not want that to apply to the background I have placed in the layer below. Yet when I put the fade on, the effect applies to the selected clip and every layer below it. How do I turn off th
-
Urgent - Table with Unicode data of 4000 length to be pulled in BI
Dear Gurus, I have a table which contains the mix type of data - Unicode, text and numeric. The Unicode field is of length 4000 chars max. Is it possible to pull this in BI 7 ? I know BI can accommodate 60 chars max in which case I need to create aro
-
No USB Functionality After Coming Out of Standby Mode - Windows XP SP2
I currently use my MacBook with Boot Camp to run Windows XP SP2 (as the default boot OS). I have enabled standby so that I can save battery power. However, whenever I come out of standby, it seems as if the USB ports no longer work. Sometimes I'll ha
-
Error when trying to open an OAF Page
HI All, I am trying to open a page while a responsibility. I have encountered an error message as below : The data that defines the flexfield on this field may be inconsistent. Inform your system administrator that the function: KeyFlexfieldDefinitio
-
What could I do for activate it just with the button? I'd really appreciate your help. I need to publish the magazine this week