Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/bar-chart-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We have resolved an issue preventing Bar chart from rendering correctly.

## [3.1.0] - 2024-12-3

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/pluggableWidgets/bar-chart-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bar-chart-native",
"widgetName": "BarChart",
"version": "3.1.0",
"version": "3.1.1",
"license": "Apache-2.0",
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function BarChart({
style,
warningPrefix
}: BarChartProps): ReactElement | null {
const [chartDimensions, setChartDimensions] = useState<{ height: number; width: number }>();
const [chartDimensions, setChartDimensions] = useState<{ height?: number; width?: number }>();

const warningMessagePrefix = useMemo(() => (warningPrefix ? warningPrefix + "i" : "I"), [warningPrefix]);

Expand Down Expand Up @@ -133,16 +133,7 @@ export function BarChart({
}

return <VictoryStack colorScale={normalizedBarColors}>{bars}</VictoryStack>;
}, [
dataTypesResult,
series,
style,
warningMessagePrefix,
sortProps,
showLabels,
normalizedBarColors,
presentation
]);
}, [dataTypesResult, series, style, sortProps, showLabels, normalizedBarColors, presentation]);

const [firstSeries] = series;

Expand Down Expand Up @@ -195,8 +186,8 @@ export function BarChart({
(event: LayoutChangeEvent) => {
const { height, width } = event.nativeEvent.layout;
setChartDimensions({
height: height <= 0 ? -1 : height,
width: width <= 0 ? -1 : width
height: height <= 0 ? undefined : height,
width: width <= 0 ? undefined : width
});
},
[setChartDimensions]
Expand All @@ -222,8 +213,8 @@ export function BarChart({
// horizontal charts.
<VictoryChart
domainPadding={{ x: style.domain?.padding?.y, y: style.domain?.padding?.x }}
height={chartDimensions?.height}
width={chartDimensions?.width}
height={chartDimensions.height}
width={chartDimensions.width}
padding={aggregateGridPadding(style.grid)}
scale={
dataTypesResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="BarChart" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="BarChart" version="3.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="BarChart.xml" />
</widgetFiles>
Expand Down
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/column-chart-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We have resolved an issue preventing Column chart from rendering correctly

## [2.1.0] - 2024-12-3

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "column-chart-native",
"widgetName": "ColumnChart",
"version": "2.1.0",
"version": "2.1.1",
"license": "Apache-2.0",
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function ColumnChart({
return sortSeriesDataPoints(series, sortOrder, dataTypesResult);
}, [sortOrder, series, dataTypesResult]);

const [chartDimensions, setChartDimensions] = useState<{ height: number; width: number }>();
const [chartDimensions, setChartDimensions] = useState<{ height?: number; width?: number }>();

// Column Chart user-styling may be missing for certain series. A palette is passed, any missing colours
// fallback to a colour from the palette.
Expand Down Expand Up @@ -153,8 +153,8 @@ export function ColumnChart({
(event: LayoutChangeEvent) => {
const { height, width } = event.nativeEvent.layout;
setChartDimensions({
height: height <= 0 ? -1 : height,
width: width <= 0 ? -1 : width
height: height <= 0 ? undefined : height,
width: width <= 0 ? undefined : width
});
},
[setChartDimensions]
Expand All @@ -178,10 +178,8 @@ export function ColumnChart({
{chartDimensions ? (
<VictoryChart
domainPadding={{ x: style.domain?.padding?.x, y: style.domain?.padding?.y }}
// width and height can't be zero
// TODO: this needs to be checked for bar chart
height={chartDimensions?.height || undefined}
width={chartDimensions?.width || undefined}
height={chartDimensions.height}
width={chartDimensions.width}
padding={aggregateGridPadding(style.grid)}
scale={
dataTypesResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="ColumnChart" version="2.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="ColumnChart" version="2.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="ColumnChart.xml" />
</widgetFiles>
Expand Down
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/line-chart-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We have resolved an issue preventing Line chart from rendering correctly

## [3.1.0] - 2024-12-3

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/pluggableWidgets/line-chart-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "line-chart-native",
"widgetName": "LineChart",
"version": "3.1.0",
"version": "3.1.1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ export function LineChart(props: LineChartProps): ReactElement | null {
const xAxisLabelComponent = xAxisLabel ? <Text style={axisLabelStyles.xAxisLabelStyle}>{xAxisLabel}</Text> : null;
const yAxisLabelComponent = yAxisLabel ? <Text style={axisLabelStyles.yAxisLabelStyle}>{yAxisLabel}</Text> : null;

const [chartDimensions, setChartDimensions] = useState<{ height: number; width: number }>();
const [chartDimensions, setChartDimensions] = useState<{ height?: number; width?: number }>();

const updateChartDimensions = useCallback(
(event: LayoutChangeEvent) => {
const { height, width } = event.nativeEvent.layout;
setChartDimensions({ height: height <= 0 ? -1 : height, width: width <= 0 ? -1 : width });
setChartDimensions({ height: height <= 0 ? undefined : height, width: width <= 0 ? undefined : width });
},
[setChartDimensions]
);
Expand All @@ -205,8 +205,8 @@ export function LineChart(props: LineChartProps): ReactElement | null {
<View onLayout={updateChartDimensions} style={{ flex: 1 }}>
{chartDimensions ? (
<VictoryChart
height={chartDimensions?.height}
width={chartDimensions?.width}
height={chartDimensions.height}
width={chartDimensions.width}
padding={aggregateGridPadding(style.grid)}
scale={
dataTypesResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="LineChart" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="LineChart" version="3.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="LineChart.xml" />
</widgetFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Fixed

- We have resolved an issue preventing Pie chart from rendering correctly

## [2.1.0] - 2024-12-3

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pie-doughnut-chart-native",
"widgetName": "PieDoughnutChart",
"version": "2.1.0",
"version": "2.1.1",
"license": "Apache-2.0",
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface Slice<X extends string, Y extends number> {

export function PieDoughnutChart({ name, presentation, series, style, showLabels }: ChartProps): ReactElement | null {
// due to the nature of the chart type, we only reply on the width, as the chart is always a square
const [chartDimensions, setChartDimensions] = useState<{ width: number }>();
const [chartDimensions, setChartDimensions] = useState<{ width?: number }>();
// Chart user-styling may be missing for certain slices. A palette is passed, any missing colours
// fallback to a colour from the palette or the default color.
const normalizedSliceColors: string[] = useMemo(() => {
Expand Down Expand Up @@ -56,7 +56,7 @@ export function PieDoughnutChart({ name, presentation, series, style, showLabels
(event: LayoutChangeEvent) => {
const { width } = event.nativeEvent.layout;
setChartDimensions({
width: width <= 0 ? -1 : width
width: width <= 0 ? undefined : width
});
},
[setChartDimensions]
Expand Down Expand Up @@ -89,7 +89,7 @@ export function PieDoughnutChart({ name, presentation, series, style, showLabels
}}
labels={({ datum }) => (showLabels ? datum.x : undefined)}
innerRadius={
presentation === "doughnut"
presentation === "doughnut" && chartDimensions.width && chartDimensions.width > 0
? style.slices?.innerRadius ?? chartDimensions.width / DEFAULT_INNER_RADIUS_RATIO
: undefined
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="PieDoughnutChart" version="2.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="PieDoughnutChart" version="2.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="PieDoughnutChart.xml" />
</widgetFiles>
Expand Down
Loading