diff --git a/packages/pluggableWidgets/charts-web/package.json b/packages/pluggableWidgets/charts-web/package.json index 518de4a1d7..d0105e01cb 100644 --- a/packages/pluggableWidgets/charts-web/package.json +++ b/packages/pluggableWidgets/charts-web/package.json @@ -1,6 +1,6 @@ { "name": "@mendix/charts-web", - "version": "6.1.2", + "version": "6.1.3", "description": "Chart widgets collection for data visualization", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/charts-web/src/package.xml b/packages/pluggableWidgets/charts-web/src/package.xml index a26f540bbb..2d9bab970e 100644 --- a/packages/pluggableWidgets/charts-web/src/package.xml +++ b/packages/pluggableWidgets/charts-web/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md b/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md index 1fac626c38..8d689ca81d 100644 --- a/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md +++ b/packages/pluggableWidgets/custom-chart-web/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Changed + +- We changed the event data to return more properties instead of only bbox coordinates. + ## [1.1.2] - 2025-09-22 ### Fixed diff --git a/packages/pluggableWidgets/custom-chart-web/package.json b/packages/pluggableWidgets/custom-chart-web/package.json index 95ee4e607d..46b17b0965 100644 --- a/packages/pluggableWidgets/custom-chart-web/package.json +++ b/packages/pluggableWidgets/custom-chart-web/package.json @@ -1,7 +1,7 @@ { "name": "@mendix/custom-chart-web", "widgetName": "CustomChart", - "version": "1.1.2", + "version": "1.1.3", "description": "Create customizable charts with Plotly.js for advanced visualization needs", "copyright": "© Mendix Technology BV 2025. All rights reserved.", "license": "Apache-2.0", diff --git a/packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts b/packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts index 7bd9b99af0..9bf8d76410 100644 --- a/packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts +++ b/packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts @@ -4,7 +4,7 @@ import { executeAction } from "@mendix/widget-plugin-platform/framework/execute- import { makeAutoObservable } from "mobx"; import { Config, Data, Layout } from "plotly.js-dist-min"; import { ChartProps } from "../components/PlotlyChart"; -import { parseConfig, parseData, parseLayout, mergeChartProps } from "../utils/utils"; +import { mergeChartProps, parseConfig, parseData, parseLayout } from "../utils/utils"; import { ControllerProps } from "./typings"; interface SizeProvider { @@ -124,8 +124,33 @@ export class ChartPropsController implements ReactiveController { private get chartOnClick(): (data: any) => void { return (data: any): void => { - if (this.props.eventDataAttribute) { - this.props.eventDataAttribute.setValue(JSON.stringify(data.points[0].bbox)); + if (this.props.eventDataAttribute && data.points && data.points.length > 0) { + const point = data.points[0]; + if (point) { + const { curveNumber, pointNumber, pointIndex, x, y, z, lat, lon, location, pointNumbers } = point; + + const eventData = { + // Common properties for all chart types + curveNumber, + pointNumber, + pointIndex, + + // Coordinate values (Cartesian 2D, 3D) + x, + y, + z, // for 3D charts + + // Map coordinates (geographic charts) + lat, + lon, + location, + + // Histogram specific properties + pointNumbers + }; + + this.props.eventDataAttribute.setValue(JSON.stringify(eventData)); + } } executeAction(this.props.onClick); }; diff --git a/packages/pluggableWidgets/custom-chart-web/src/package.xml b/packages/pluggableWidgets/custom-chart-web/src/package.xml index 2fcf393346..b4c9a67025 100644 --- a/packages/pluggableWidgets/custom-chart-web/src/package.xml +++ b/packages/pluggableWidgets/custom-chart-web/src/package.xml @@ -1,6 +1,6 @@ - +