0

Note: Question starts with a long description, maybe you want to skip. Roll down until you see big heading The real question.

I have table with measured values. There is one set of the values, but two sets of relevant data one is absolute value (time) t and other is relative value (time) Δt showing change from measurement beginning.

Table with columns t, delta t, Value

I want to show the values with two axis one shows t and other Δt.

So I created scatter chart with two data series.

Y-values ies Values column, X-values is delta t column

Y-values ies Values column, X-values is t column

And made combined scatter & scatter chart from them. Notice different scope of each horizontal (X) axis.

Chart shows two same data series shifted according their axis scope and origin

Because I want only one data series shown in the chart I edited X-axis scopes (0-70 for Δt and 7-77 for t). This made both series same (same size and same origin - Value = f(t) is not visible, because is hidden under Value = f(Δt)).

Data series overlaps. Upper x-axis shows values 10, 20, 30 ... but lower 7, 17, 27 ...

The real question

Now the chart plot a area looks OK. But I'd like to have "nice" round values shown on t axis. It's even possible and if yes, how?

I want the lower x-axis looking like in an image below (ancient mspaint-fu used here :) ).

Manipulated image with desired output

2 Answers 2

1

Maybe you could add another Helper series, that the X-values include the number that you need on X-axis, the Y-values are all 0.

Then add the series into the chart.

Set no laber for the lower X-axis, but add the lables for Helper series.

Then double click each labe, enter "=" in formula bar, then click the number that you want to show.

enter image description here

0

Big thanks to Emily's answer for great suggestion. I have created more complex solution with 2nd axis lines.

This is final result (I kept it orange, it's more distinguishable.).

enter image description here

How it works

Another data series is used for a secondary axis (orange). This helping series goes out of the visible part of the chart. So only vertical lines are visible.

Numbers on horizontal axis are data labels (data from a range) actually. This is how whole helping data series looks like

enter image description here

Notice that each point of this series has its own label. But labels are shown only for points presented in the visible part of the chart. (Labels visible in the final result are placed on X-axis (coordinate on Y-axis is zero).

Peaks above and under are needed for cosmetic reasons. Otherwise horizontal connections (lines) between visible points are visible too.

The helping data series is driven by this table named HelpingTable

Helping Table

Notice column named Label which is source of the data labels.

This HelpingTable could be stretch to desired length. Stretching leads to dynamic change of the helping data series in the chart. Data in the table are calculated from these parameters

Parameters for helping table

  • Min Y bottom end of vertical lines
  • Max Y top end of vertical lines
  • Min X position of the first vertical line
  • Max X position of the last vertical line
  • Step X distance between vertical lines
  • RowsNeeded how much you have to stretch the HelpingTable to cover whole wanted range
  • t/Δt diff (static) difference between values on the chart axis and a new "axis" represented by helping data series

There is also 2nd helping table named YValuesTable which holds Y values of the helping data series points.

YValuesTable

Only column Y is calculated here. Using this simple formulas:

  • AboveTopAxis = Max_Y+(Max_Y-Min_Y)
  • TopAxis = Max_Y
  • BottomAxis = Min_Y
  • BelowBottomAxis = Min_Y-(Max_Y-Min_Y)

Finally the HelpingTable columns are calculated using these formulas

enter image description here

  • Row =ROW()-ROW(HelpingTable[[#Headers],[Row]])
  • Step =ROUNDUP((ROW()-ROW(HelpingTable[#Headers]))/3,0)
  • Label =Min_X+([@Step]-1)*Step_X
  • X =[@Label]+t_Δt_diff
  • Y =INDEX(YValuesTable[Y],MATCH(IF(MOD([@Row],6)>3,6-MOD([@Row],6),MOD([@Row],6)),YValuesTable[ID],0))

Calculation of the Y column is maybe a little overkill, but I had limited time.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.