To be simple, I have a Excel PowerQuery request which download a table from the web.
I'm trying to draw a graph with multiple lines, the horizontal axis is always the dates, and the vertical axis is composed from all the lines.
Here an example of what it look :
My objective is to catch all the data of the table dynamically without having every time to extend the data range by clicking on the graph.
On the data range :
By using =Table_0__6[[#Tout] I get all the table data, but my goal is to catch only the Dates column (horizontal axis) and two other columns of entry for the data series.
I tried many ways.
By example, if the columns were adjacent, the data range could be :
=Table_0__6[[#Tout];[Date]:[Column 2]]
Since the entry columns are not adjacents, I tried to link the data series by ; or + like this : (not working)
=Table_0__6[[#Tout];[Date]:[Column 1]]+Table_0__6[[#Tout];[Date]:[Column 2]]
or even : (not working)
=Table_0__6[[Date];[Column 1]+[Column 2]];
My question is : Do you have any idea on how catching in horizontal axis every data of Date column from the table, and for the veritcal axis every data of column 1 and 2 ?
Have a great end of week
Respectfully
Thanks
Related
can you please help me by telling how to plot line graph in python(python 3.x preferably) using two lists containing string values.
my lists looks like:
y= ['27%', '27%', '27%', '27%', '27%', '27%', '27%']
x= ['18ww25', '18ww27', '18ww28', '18ww28.1', '18ww29', '18ww29.1', '18ww29.2']
moreover, there are multiple such pairs with different y list but same x list. Moreover x list should form markers on the X axis.
Moreover I am extracting these values from an excel file using pandas because of which I am getting values like "18ww28.1" although in excel file it is present as "18ww28"
how to plot a single graph containing all the lines from such pairs by correcting all x list values(for eg from "18ww28.1" to "18ww28") and then plotting.
If 7 pairs are there then the 7 lines should be there in graph and y list values should be plotted in the same format(in percentage)
the table which i want to plot is- excel table
actually, this file originally conatins many tables. I have read the complete file in a pandas data frame then grouped this table then converted this table to csv and then iterated through each row by storing each row value to a list and have also stored 1st row value in a list and want to plot each row list against first row list in such a way-
row1_list=['18ww24','18ww25','18ww34'](for ex)
row2_list=['24%','25%','67%'](for example)
This basically means consumption of some resource is '24%' on '18ww24' thats why I have to plot ('18ww24','24') as a point in graph(same for all the corresponding values of both the list)
then similarily,
row1_list
row3_list
and so on for every row......
Also, 1st row should form markers on X axis against which every entry of other rows are plotted and the plotted line for each row should be on same graph
I need to display this kind of data in one chart:
Which means:
Function A: Y= X + 10 ;
Function B: Y= X * 2 ;
but what I got from excel is:
Actually what I want is (sorry for the drawing):
My real data is like:
If I format it like this:
I can still not get the correct charts.
Updated to account for change of question
Your data structure is wrong to achieve this in Excel, see for example:
On the left you want your x axis values, don't put a header in this column otherwise it will plotted on your graph as a series (extra line).
You can fill in gaps in your data with #N/A and excel will ignore these points, joining the line to the next available point.
How can I make line chart from this data?
Two lines
X values = time
Y valies = number
This is just small sample of data (I have more than 30 day).
(I use Excel 2016)
Thanks
Make sure your X-axis is the first column and your Y axis is your 2, 3, 4, etc column
Highlight you data that you want to work with, minimum two column.
Find your Insert Ribbon
Select Insert Chart about halfway across and and make sure you select the line one. (Personally I would use and XY scatter plot with lines)
In your case where you have X, Y , X, Y as the sequence of your column, I would edit your data series afterwards to eliminate the series which are really your second X values. Then go to your subsequent Y values, edit their series, and select a new X series for each.
Its usually much easier if you place all your X data in one column, and each Y series in its own column making sure it lines up with the appropriate X data.
I want to create an automated scatter plot. This is the first example table based on the step size I end up measuring A, B, C, D for a specific frequency. In this scatter plot I created manually you can see I want to plot C v/s A for a particular frequency.
But I need to do this automatically as based on the step size the number of row can change. Here, since the step size decreased the number of samples increased, and now the scatter plot needs to update number of A and C values it plots.
Is there a formula I can use without using any macros?
The relation between the step size and frequency is (number of samples of a single frequency = (360/step size)) so for a step size of 60 you will have in reality six entries of frequency 100 and six of 200 .
You can use formulas to define chart ranges if you hide the formulas in named ranges. Combine that with the fact that #N/A values are not plotted and you can get this to work without VBA.
For your example graph you could define two names ranges as follows:
Name: A_100
Refers To: =IF(Sheet1!$E$3:$E$100=100,OFFSET(Sheet1!$A$3,0,0,360/Sheet1!$B$1,1),NA())
and
Name: C_100
Refers To: =IF(Sheet1!$E$3:$E$100=100,OFFSET(Sheet1!$C$3,0,0,360/Sheet1!$B$1,1),NA())
Then set the X and Y axis of the chart to SheetName!A_100 and SheetName!C_100
The if statement filters out all the points not at frequency 100, if you have a formula for selecting the frequency replace "Sheet1!$E$3:$E$100=100" with that.
The offset function takes the first cell in the column and expands the number of rows according to your 360/step size formula.
Please view this image (focus to red around area):
I cannot get it to work with the letters, but I can get it to work with numbers (=CODE(A1)-CODE("a")+1):
UPDATE after reading Jean-François's answer (but on another computer):
Added a second series just for the custom labels
Show data labels for the new series
Explicitly set the Y axis minimum at 0
Deleted the original X axis labels
Deleted the legend entry of the second series
A few more steps and we're there:
multiplied the X axis values by 10, to adjust granularity for positioning stuff
subtracted 5 for series1 values, to get the data in the middle between major tick marks
played with series2 values, to get the labels also in the middle between major tick marks
Here's an easier way.
Set up the data like this:
Select the first two columns (blue) and insert a column chart (zero value columns do not appear):
Select and copy third and fourth columns (red), select the chart, Paste Special as new series, check first column and first row boxes (it's added as another column):
Right click new column series, choose Change Series Chart Type, and select the XY with Lines style:
Right click XY series, choose Format Data Series, change to Primary Axis: