Three data sets in a single Flex chart?
Hello everyone;
I've successfully integrated two data sets into a single Flex
chart; now I'm wondering how to bring in another one. Here's an
example of what I'd want to do. Say I wanted to chart average
lifespan and average household income by US State. So I'm imagining
each state could be represented by a pair of bar charts - one
representing lifespan and using the left y axis and one
representing income and using the right y axis. The third component
would be the state, which the user should be able to display or
hide. I'm imagining states being represented by color and a label
on the x axis, and user controls to display more or fewer years.
Any change I could actually pull this off?
Thanks for any help.
I'm not entirely certain where the conflict from adding
States would appear, but I'm a little unclear on your data model.
Have you considered putting all the information into a single data
set? I would suggest filling an Array Collection with a class like
this:
public class infoHolder
public var lifespan:int;
public var salary:int;
public var stateName:string;
Then you can simply fill your chart like this:
Similar Messages
-
Hi all,
I would like to have a data connection file used by excel to extract data form a SQL Server DB (so that change in location of the DB needs only a change to the single data connection file). The excel file will retrieve data from only a single database,
but there are multiple queries (30+) stored on SQL server that are used - each SQL server views' data is returned to a pivot table in an excel worksheet, which has an associated chart with various slicers on the main dashboard worksheet.
Do I need a seperate data conenction file for each SQL server query being retrieved, or can a single connection file be created as all data comes from a single database?
(all my attempts and research on the net have led me to believe that a seperate file is needed for each view, but this seems unnecessary)Hi, im learning my way with this, so apologies if I am providing too much or too little info.
There are 8 source files which are very loosely related in that they capture infromation regarding what has happened within a metro railway over a day. However there are only a few relationships between the contents of tehse files.
These tables are imported into SQL Server using SSIS where I have developed a number of views that query these 8 source tables to generate a number of metrics to provide insight into the service provided to the passengers. Some examples of metrics are: Number
of passengers in transit at any given time, time taken to travel between adjacent stations, how much power was used during the day, what distance did the trains travel during the day, etc. Some views provide only a handful of rows, some provide 1M plus. There
are now approx 40 seperate views created.
I have then used a spreadsheet with a worksheet associated with each SQL server view. Each worksheet is set up as a pivot table, which allows the related chart on the main dashboard worksheet to use standard excel capability to slice and present the data
in different ways.
At the moment if the server on which teh database is stored moves, I have had to recreate the spreadsheet from scratch as I dont know how to change the connection information in any other way. Ideally I would like to have connection info in a single place
to reduce ongoing maintenance, particularly as I would like to place the spreadsheet on a SharePoint server to distribute it to other users.
Thanks -
Merging data sets in a single graph in Excel
I want to make a graph in excel. I have two data sets, one horizontal and one vertical: e.g.
Data set 1 (few data point)
Date: 1-1-2010; 1-1-2011; 1-1-2012
Value 1000 5000 6000
Data set 2 (many data points)
Date Value
1-1-2010 10
2-1-2010 9
3-1-2010 8
1-1-2011 11
1-1-2012 12
I want the data sets in ONE graph with the two different data sets in the graph. Where the x values are correct of course.
I dont need to merge the data sets or something like that
I really need good help for thishttp://answers.microsoft.com/en-us/mac/forum/macexcel?tab=Threads
-
Displaying multiple data sets on a single chart.
I am collecting data from 5 identical stations. There is not enough room to display 5 charts on my screen so I have set up a station selection drop down so the user can determine which set of data is displayed.
My problem is that I don't know the best way to store the data in the background. I need to store something like the last 500 data points for each station.Hi;
LabVIEW automatically allocate memory for your data in the program, which mean that while the program is running you can think that your data can temporarely be stored in the wires of your code
To see what I mean, check the attached vi. It allows you to select which waveform to display in the chart, which look like it "stays" in the border of the while loop. This is just a "quick & dirty" solution. Because are only 500 points per station, it should not be too much problem.
Another q&d way to do something similar is by using local variables.
To store the data indefinively, consider saving it in a spreadsheet-style file.
Regards;
Enrique
www.vartortech.com
Attachments:
Select_source.vi 48 KB -
Spry XML data set and dynamic post variables
Hi,
I am trying to create an XML data set that has dynamic post
variables.
Everytime something is pressed on the page a variable changes
and I then want to reload the XML data set using the new variable.
I know I can just pull in an XML with all possible variables
and filter client side but this would make it way too large.
Does anyone know what I may need to do.
I tried this:
var myVar = 0;
var dss = new Spry.Data.XMLDataSet (
'../../cgi-bin/server_details.pl' , 'top' , { method: 'POST' ,
postData: sid=ajaja21&ip=127.0.0.1&cid=' . myVar ,
subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
"true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
"descending", useCache: false, loadInterval: 10000 } );
onclick="myVar=1";
But the script doesn't understand the post variables sent (it
does when I remove the . myVar part and put in a static value). I
think it isn't sending that dynamic variable with the post
variables.
Any ideas anyone?
ThanksWell I had it working when I stripped back everything and
just had the dss data set and a single onclick function, but now
that I put it back together it hash foobared again.
Here are the relevant bits of code that I've changed.
The function to change server id:
//function to run when changing the server id
function changeServer ( sid ) {
//set the url to use the current server id
dss.setURL = ( '../../cgi-bin/server_details.pl' , { method:
'POST' , postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid='+sid
//force a reload of the server data
dss.loadData();
The inital load of the data set
var dss = new Spry.Data.XMLDataSet (
'../../cgi-bin/server_details.pl' , 'yams' , { method: 'POST' ,
postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid=0' ,
subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
"true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
"descending", useCache: false, loadInterval: 10000 } );
And the part that changes the server id
<td align="left" style="cursor:default; width:174px;"
onclick="changeServer({dsv::servers/server/@id})">{dsv::servers/server/name}</td>
I checked that the function is receiving the correct server
id and I even tried hard coding the cid variable to 2 in the change
function but it still wasn't changing on the server side.
Any ideas?
Thanks -
I have made a basic XML file that gets written to from the
inputs of a form. All the information is written in the XML file
correctly, but when the data is inserted, the new data doesnt
display in the Spry table (evan with DW closed). I have a page for
the form and a page to display All the data. The only way i can get
the table to show the updated data is to close the browser and
reopen. After i insert the data to the file i get the "File has
been modified outside of Dreamweaver, Reload it" prompt. Is there a
setting i should change? My XML file is in the root folder of my
site on the local machine, i am using Vista Ultimate and
ASP.Well I had it working when I stripped back everything and
just had the dss data set and a single onclick function, but now
that I put it back together it hash foobared again.
Here are the relevant bits of code that I've changed.
The function to change server id:
//function to run when changing the server id
function changeServer ( sid ) {
//set the url to use the current server id
dss.setURL = ( '../../cgi-bin/server_details.pl' , { method:
'POST' , postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid='+sid
//force a reload of the server data
dss.loadData();
The inital load of the data set
var dss = new Spry.Data.XMLDataSet (
'../../cgi-bin/server_details.pl' , 'yams' , { method: 'POST' ,
postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1&cid=0' ,
subPaths: [ "auth" , "plugins" , "plugins/plugin" ] , keepSorted:
"true", sortOnLoad: "plugins/plugin/order", sortOrderOnLoad:
"descending", useCache: false, loadInterval: 10000 } );
And the part that changes the server id
<td align="left" style="cursor:default; width:174px;"
onclick="changeServer({dsv::servers/server/@id})">{dsv::servers/server/name}</td>
I checked that the function is receiving the correct server
id and I even tried hard coding the cid variable to 2 in the change
function but it still wasn't changing on the server side.
Any ideas?
Thanks -
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. -
How to set date format dd.MM.yy for chart time axis
Is it possible to set default date format dd.MM.yy instead of MM/dd/yy in Flex charts without using label function ?
In this case we do not know beforehand the length of the time span; it can be minutes, days or weeks.
Setting locales in compiler options or locale settings for application seems not having any effect.For example
- mx:Barchar
- if time span is 4 minutes; time axis format is HH:mm and shows 10:00, 10:01, 10:02, 10:03 ; *this correct*
- if time span is 5 days; time labels are automatically in MM/dd/yy format; question is how to change this automation
to format dd.MM.yy
- how to do this *without* dateformatter and *without* coding "if time span is is longer than day nyt less than week then use dd.MM.yy format" ? -
SQL Update a Single Row Multiple Times Using 2 Data Sets
I'm working in tsql and have an issue where I need to do multiple updates to a single row based on multiple conditions.
By Rank_
If the column is NULL I need it to update no matter what the Rank is.
If the Ranks are the same I need it to update in order of T2_ID.
And I need it to use the last updated output.
I've tried using the update statement below but it only does the first update and the rest are ignored. Here is an example of the data sets i'm working w/ and the Desired results. Thanks in advance!
update a
set Middle = case when a.Rank_> b.Rank_ OR a.Middle IS NULL then ISNULL(b.Middle,a.Middle) end,
LName = case when a.Rank_> b.Rank_ OR a.Lname IS NULL then ISNULL(b.LName,a.LName) end,
Rank_ = case when a.Rank_> b.Rank_ then b.Rank_ end
from #temp1 a
inner join #temp2 b on a.fname = b.fname
where b.T2_ID in (select top 100% T2_ID from #temp2 order by T2_ID asc)The Merge clause actually errors because it attempt to update the same record. I think this CTE statement is the closest I've come but I'm still working through it as I'm not too familiar w/ them. It returns multiple rows which I will have to
insert into a temp table to update since the resulting row I need is the last in the table.
;WITH cteRowNumber
AS(
Select DISTINCT
Row_Number() OVER(PARTITION BY a.LName ORDER BY a.LName ASC, a.Rank_ DESC,b.T2ID ASC) AS RowNumber
,a.FName
,a.LName
,b.LName as xLname
,a.MName
,b.MName AS xMName
,a.Rank_
,b.Rank_ AS xRank
,b.T2ID
FROM #temp1 a
inner join #temp2 b
ON a.fname = b.fname
), cteCursor
AS(
Select a.RowNumber,
a.Fname
,a.LName
,a.xLname
,a.MName
,a.xMName
,a.xRank
,a.T2ID
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xRank,a.Rank_) else ISNULL(a.Rank_,a.xRank) end AS Alt_Rank_
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xMName,a.MName) else ISNULL(a.MName,a.xMName) end AS Alt_MName
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xLName,a.lname) else ISNULL(a.LName,a.xlname) end as Alt_Lname
FROM cteRowNumber a
where a.RowNumber = 1
UNION ALL
Select crt.RowNumber
,crt.FName
,crt.LName
,crt.xLname
,crt.MName
,crt.xMName
,crt.xRank
,crt.T2ID
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xRank,Prev.Alt_Rank_) else ISNULL(Prev.Alt_Rank_,crt.xRank) end AS Alt_Rank
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xMName,Prev.Alt_MName) else ISNULL(Prev.Alt_MName,crt.xMName) end AS Alt_MName
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xLName,Prev.Alt_Lname) else ISNULL(Prev.Alt_Lname,crt.xLName) end as Alt_Lname
FROM cteCursor prev
inner join cteRowNumber crt
on prev.fname = crt.fname and prev.RowNumber + 1 = crt.RowNumber
SELECT cte.*
FROM cteCursor cte -
How should i use the two results sets in one single report data region?
Hi frnz,
I have to create a report using the below condition...
Here my given data set query gives you the two result sets ,so how should i use that two result sets information in single report....when i accessing that data set query it will take the values off the first result set not for the second result set.
without using sub report and look up functionality..... if possible
is there any way to achieve this.....Please let me know..
Thanks!You cant get both resultsets in SSRS. SSRS dataset will only take the first resultset
you need to either create them as separate queries or merge them into a single resultset and return with ad additional hardcoded field which indicates resultset (ie resultset1,resultset2 etc)
Then inside SSRS report you can filter on the field to fetch individual resultsets at required places. While merging you need to make sure metadata of two resultsets are made consistent ie number of columns and correcponding column data types should be same.
In absence of required number of columns just put some placeholders using NULL
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
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 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 -
I only occasionally use numbers 08. When I make a bar chart from a data set the size of the data set seems limited. That is, after a certain size, if I add one more data value to the data set then the chart displays the new item but does not include the first item in the set. Is there a solution to this?
DavidLewis wrote:
I only occasionally use numbers 08. When I make a bar chart from a data set the size of the data set seems limited. That is, after a certain size, if I add one more data value to the data set then the chart displays the new item but does not include the first item in the set. Is there a solution to this?
I didn't notice this problem with a data set that started with 10 items and then had 15 more added to it.
Expanding that to a bar graph starting with about 40 items in the data set, then adding items to a total of 362 was a slow process, but did not exhibit the problem you describe.
The chart is a bar graph showing values of Sine(n°) for integer values of n from 0 to 361.
How many items are in your set?
How are you adding one more data value to the data set to be included in the chart?
Regards,
Barry -
How to get UI5 Chart selected data set index
Hi experts,
I am facing problem with ui5 bar chart. i am not able to get the selected data set index of selected bar on the chart.
I am using below method, but not getting any result from this method.
ObjectName.getChartObject().getSelectedDataSetIndices()
please suggest any methods are avaliable to get selected index?
Thanks & Regards
VenkatHi Venkat,
You can get the legend index and y-value by using the below code in the event handler that you have registered for ChartSelectionEvent:
var meaureIndex = event.srcElement.__data__.ctx.path.mi + 1;
alert(meaureIndex); //hack for getting legend index
var selPoint = c.getChartObject().getSelectedPoint();
alert(selPoint); //selected bar index
var yValue = c.getChartObject().getYDataValueAt(meaureIndex,selPoint);
alert(yValue);
Using the legend index you should be able to get the legend name.
Please note that parts of the above code for getting legend index is a hack (not in i5Chart documentation/reference)
Hope this helps!
Regards,
Ria -
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
Maybe you are looking for
-
Programatically convert CS5 and CS6 illustrator files to lower versions
Is there a way to programatically convert CS5 and CS6 illustrator files to lower versions (CS4, CS3 etc) programatically. Are there any third party tools to do it or does Scripting let you do that.
-
PHP: image link- rel or site?
When it comes to php, I'm a newb. I don't know much about writing the code. Here's my issue: I'm having problems with displaying an image in my right column (rightcol.php). The image is viewable when you go to http://www.spartanburgfamilydentistry.c
-
Premiere elements 10 to youtube problems
I am trying to upload a video from premiere elements 10 to youtube through their "easy" "fastest" "process". After going through and clicking online, then youtube, I click authorize. I put my info in and it logs me in. I then am prompted to accept th
-
Hi , I am working on the employee download. Have done all the stettings as per the note 550055 and ran the RHALEINI in R/3. In CRM the IDOC are shoowing the status 64 ' IDoc ready to be transferred to application'. What could be the problem in postin
-
Is it possible to know which tool is selected
I've successfully registered for the 'slct' event and have Photoshop calling back to my script so that I can handle it. However, I'm trying to target the marquee select tool specifically and so I need to know which tool has been selected. Is there an