XY Chart - adding batch labels

I'm migrating some old PHP web pages to Perspective. The original is generated using jqPlot which has the nice feature of being able to add in in the batch sequence numbers shown in green circles on the chart below. The batch sequence number is repeated in a table below the chart. This makes it easy to find the batch's corresponding row in the table.

Can anyone think of a way of achieving a similar result in Perspective's XY Chart?
I can generate datapoints with X value to match the end of weighout and a constant Y-value of 70 kg.

How could I generate the labels?
How could I embed the 1, 2, 3, ... batch numbers?

Many thanks.

It seems that my best shot is,

  • Create a batch-number dataset with (t_stamp, number) pairs. Number is in sequence 1, 2, 3, etc.
  • Create another y-axis. I set the axis range to very large numbers so that the difference in vertical position of my batch numbers is not discernable. In my case I made it max : 1000 and min : -10000. This forces the zero line above the top of my other charts.
  • Add another series and set it to line. Bind it to the batch-number dataset.

It's not exactly what you're asking, but you could use tooltips and bullets on the weight dataset and put the batch number in that datasource.

I don't think one can do that. The tooltips can read {valueY} but not other columns in the dataset. I've posted some work on the XY Chart tooltips here. In any case they don't appear until the user hovers over the point so - no use!

I've added tooltips to the batch number bullets so now I have both.

Now to try and add a circular backfill ...

1 Like

Hi @Transistor
I need to create feature similar kind what u did.
I am going to develop X bar R chart in Perspective

Below image which developed in vision module

if mean is above UCL limit or below the LCL limit. I need to show the datapoint in red color and label with number
Can you give me guidance how to achieve this in XY chart perspective

I think your best options are:

  • Create the labels as another series as I've described in post #2. You would write a script to only add in the labels for the out-of-band values. If you want labels over the high values and under the low values you will need two series.
  • Create yet another series with just the red points. Set that series with
    series.x.line.appearance.stroke.opacity : 0
    series.x.line.appearance.bullets.0.enabled : true
    series.x.line.appearance.bullets.0.fill.color : red
    series.x.line.appearance.bullets.0.stroke.color : red
1 Like

Thanks i will try it out

So from my understanding i need to create 2 dataset with out of bound values through scripting and then create 2 series call the dataset column right?

If your upper and lower deviations are both going to be the same color (red in your sample) then one dataset would do, wouldn't it?

Adding in the labels on those points might require more work.

I haven't used them but the Apex Charts may have some of the features you're looking for.

Yes one dataset is enough

But apex chart is third party chart right?

Yes. It is written by KyvisLabs. That is all I know about it.