XY Chart Perspective Dynamic Bullet Colour Change

Help Needed: Dynamic Bullet Color in XY Chart Based on SQL Data (Perspective)

Hi everyone,

I’m currently working on a Perspective XY Chart, and I need help applying dynamic bullet colors in series[0] based on a threshold value.

:white_check_mark: Objective:

Color the bullet (marker) of each point in the chart:

Red if the Y-axis value exceeds a threshold (e.g., > 1)

Blue otherwise

:bar_chart: Setup:

Chart Type: XY Chart in Perspective

Series: series[0]

Data Source: Named Query (querying SQL data)

Dataset contains:

Timestamp (x-axis)

NumericValue (y-axis)

Source (label/tooltip)

:gear: What I Tried:

I bound series[0].data to the Named Query and applied a Script Transform to add a "bulletColor" key per row, like so:

newData =

for row in range(value.getRowCount()):
xVal = value.getValueAt(row, "Timestamp")
yVal = value.getValueAt(row, "NumericValue")
sourceVal = value.getValueAt(row, "Source")

newData.append({
    "x": xVal,
    "y": yVal,
    "source": sourceVal,
    "bulletColor": "red" if yVal > 1 else "blue"
})

return newData

In the chart configuration, I set:

series[0].x → "x"

series[0].y → "y"

series[0].source → "source"

series[0].bullet.fill → "bulletColor"

:cross_mark: Issue:

Despite trying this approach and variations of it:

The bullet color is not changing dynamically

Or the chart throws an error like "array found, string expected"

Or the chart shows no data

:puzzle_piece: Questions:

  1. Is this approach officially supported in Perspective for per-point bullet colors?

  2. Does bullet.fill accept dynamic values from series[0].data rows?

  3. Is there an alternative method (e.g., using scripting or styling per series) that works reliably?

Any guidance, working example, or reference is truly appreciated — I’ve been exploring this for a few days and would love to know if others have solved this cleanly.

Thanks in advance! :folded_hands:

Welcome to the forum!
Please see Wiki - how to post code on this forum. You can edit your post to fix it. Thanks.

Configure the color variable in deriveFieldsFromData
series[n].line.appearance.bullets[0].deriveFieldsFromData.fill.color : "bulletColor"