Making a scatter plot with CFCHART - coldfusion

I am trying to build a scatter plot with ColdFusion 9. The input for the x axis is numeric and not evenly spaced. Here's what I tried:
<cfquery name="qryData" datasource="#datasource#">
SELECT x, y
FROM data
</cfquery>
<cfchart format="png" xaxistype="scale">
<cfchartseries type="scatter" query="qryData" itemcolumn="x" valuecolumn="y">
</cfchart>
This generates a graph with the x values in the same order as they are in the query, rather than in numerical order:
What do I need to change to get a real scatter plot with the x axis in numerical order and correctly spaced between values?

Related

How to make PowerBI redraw the chart based on a legend is selected

I have a table in PowerBI as my data source.
Table
| Time | type | count | environment |
And I have 2 charts for that table.
Line chart (x axis is Time, y axis is sum of count, legend is type)
Stacked column chart (x axis is Time, y axis is sum of count, legend is environment)
My question is when I select 1 legend in the line chart, the Stacked column chart get redrawn. The values of the selected legend is drawn with normal colors but other values is still shown as 'faded' color.
i.e. something like this
Can I make the stacked column chart to be redrawn so that the values only shown the legend which was selected in the line chart.
That's called cross filtering. If you want full filtering put the legend into a slicer next to the column chart und you'll get the desired effect.

PowerBi - Create chart using 2 X axis value and 1 Y axis Value

I want to create chart in powerbi. There are 2 X axis value(Date) and one Y axis value(amount). Below is the source data table.
Final table should look like below image
Output chart:
Can someone help me out to put together the chart.
From ShiftDate and BilledDate, add columns Shift_Month, Billed_Month for name of the months in Data Table
Create calculate Table Billed_Table using DAX: Billed_Table = SUMMARIZE(Data, Data[Billed_month], "Sum_Billed", CALCULATE(SUM(Data[Amount])))
Create calculate Table Shift_Table using DAX:Shift_Table = SUMMARIZE(Data, Data[Shift_Month], "Sum_Shift", CALCULATE(SUM(Data[Amount])))
Then join Billed_Table and Shift_Table
Now go to power view and plot column chart using join_table data

Expand X-Axis Area to Reduce Clutter Among Observations

I have the following code which produces a bar graph; however, I have over 30 observations(names of providers) in the first_md_seen variable thus the graph's x axis is super cluttered.
Is there a way to expand the size of the graph area so I can clearly see every observations within first_md_seen variable and add some space between each of the observations so they are discernible?
As you can see in my code I changed the display positioning of the observations to vertical, but this did not help much.
Thanks!
proc sgplot data = day1;
vbar first_md_seen / response = median fillattrs=(color=lightblue)
dataskin=gloss datalabel
categoryorder=respdesc nostatlabel;
xaxis grid display=(nolabel)
fitpolicy=rotate
valuesrotate=vertical;
yaxis grid discreteorder=data display=(nolabel);
run;

sorting stack bar chart in power BI

I am using a stacked bar chart for presenting the gender ratio in various region.
here the legend is gender and Axis is region and value is headcount.
when i want to sort the chart according to female gender value . the sorting is only done by the headcount value. how can i sort it for the percentage value. please help me.
EDIT: My first answer focused only on count, now I've taken into account that OP wants to sort by percentage female value
You can sort your data directly in your Stacked column chart visualization, after pivoting the data and adding a column showing the female percentage value using the Power Query Editor. If you insert the female ratio as a Tooltip, your chart can be sorted as that value even though it is not displayed in your chart.
Here are the details:
This data sample should fit your description:
Region,Gender,Count
USA,M,9000
USA,F,7000
EU,M,5000
EU,F,5000
UK,M,2000
UK,F,4000
CAN,M,100
CAN,F,900
If you enter that data using Edit Queries / the Power Query Editor, you can set it up like this:
Now highlight the Gender column, and select Transform > Pivot Column to get this:
Under Values Column, select Count and click OK to get this:
Now simpy add a custom column to calgulate the female ratio like so:
Now your table should look like this:
In the desktop, insert a stacked column chart and set it up like below. Notice that you'll need to insert F ratio under Tooltips:
Now you can sort your chart by Ascending or Descending F ratio

SAS: how to plot boxplots for each quantitative var in few lines of code

I have one qualitative variable ("Group") and 38 quantitative variables ( some chemical elements: Al, Mg, K, Cu...): I would like to plot a boxplot for each of those quantitative vars against the qualitative one (eg. y-axis = Al, x-axis = Group) but in a single (or few) lines of codes, instead of typing this
proc boxplot data= Dataana.Pot;
plot Al*Group;
run;
38 times with a different elements.
How could I do this?
Thank you very much!
RTM
PLOT (analysis-variables)*group-variable <(block-variables )> <=symbol-variable> </ options > ;