Skip to content

Update funnel and gauge chart. #1400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0bd9122
Added opacity in Funnel Chart.
Imiss-U1025 Dec 6, 2024
0b84762
Added funnel Align in Funnel Chart.
Imiss-U1025 Dec 6, 2024
f006f89
Added sort in Funnel Chart
Imiss-U1025 Dec 6, 2024
ee0161b
Added font settings.
Imiss-U1025 Dec 9, 2024
4f9b411
Added label, Chart style.
Imiss-U1025 Dec 9, 2024
1d062e0
Added legend font settings.
Imiss-U1025 Dec 9, 2024
4058b81
Added gradient background.
Imiss-U1025 Dec 9, 2024
fb58dfa
Fixed an issue that style order would appear different in theme setti…
Imiss-U1025 Dec 11, 2024
b2ee751
Fixed direction and label style.
Imiss-U1025 Dec 11, 2024
8487136
Added direction's default value.
Imiss-U1025 Dec 11, 2024
006ab19
Implemented settings of theme as default.
Imiss-U1025 Dec 12, 2024
1ddd139
Implemented gradient background color again.
Imiss-U1025 Dec 12, 2024
2045823
Fixed an issue that update-on-action when activating /deactivating pr…
Imiss-U1025 Dec 12, 2024
b77d3e0
Fixed direction on theme setting.
Imiss-U1025 Dec 12, 2024
216b753
Added chartOpacity, chartBoxShadow, chartBorderStyle, chartBorderRadi…
Imiss-U1025 Dec 12, 2024
4de9835
Added ChartBackgroundColor, ChartGradientColor, ChartShadowColor, Cha…
Imiss-U1025 Dec 12, 2024
bc5936a
Added initial value of funnelChartUtils.
Imiss-U1025 Dec 12, 2024
10cb9eb
Fixed a direction split issue.
Imiss-U1025 Dec 13, 2024
dad3997
Fixed Chart styles UI of right panel.
Imiss-U1025 Dec 13, 2024
ca9bbcf
Updated guage chart.
Imiss-U1025 Dec 14, 2024
9010367
Added styles to gaugeChart.
Imiss-U1025 Dec 14, 2024
fe9e505
Added Pointer and Fixed default values
Imiss-U1025 Dec 14, 2024
c14a22d
Updated Gauge Chart.
Imiss-U1025 Dec 16, 2024
94c0f92
Updated Gauge Chart.
Imiss-U1025 Dec 16, 2024
4e9422b
Added axis style to Gauge chart.
Imiss-U1025 Dec 16, 2024
76474f7
Added roundCap, theme setting to Gauge chart.
Imiss-U1025 Dec 16, 2024
e27f7ca
update-on-action when selecting theme.
Imiss-U1025 Dec 16, 2024
03bc7bd
Added radical gradient and many fields to Candlestick chart.
Imiss-U1025 Dec 16, 2024
6384363
Added datazoom, grid to candleStick chart.
Imiss-U1025 Dec 17, 2024
4098b68
Added an ability that legend of funnel can be on the left or right.
Imiss-U1025 Dec 17, 2024
5849081
Added horizontal, vertical icons
Imiss-U1025 Dec 17, 2024
4ae4427
Fixed legend option of funnel charts
Imiss-U1025 Dec 17, 2024
cd45364
Fixed icon colors and changed order.
Imiss-U1025 Dec 17, 2024
b74acba
Added title Vertical
Imiss-U1025 Dec 17, 2024
76bd5ff
Changed Align order on Funnel chart
Imiss-U1025 Dec 18, 2024
03f51ac
Added descriptions to properties of funnel chart.
Imiss-U1025 Dec 18, 2024
e5fbd92
Added descriptions to properties of gauge chart.
Imiss-U1025 Dec 18, 2024
84b4285
Applied gradient colors to a chart using just one color picker
Imiss-U1025 Dec 18, 2024
b3ff98f
Fixed trans in gauge chart.
Imiss-U1025 Dec 19, 2024
98a8e3d
Fixed trans in funnel chart.
Imiss-U1025 Dec 19, 2024
85a6786
Reverted candlestick chart, updated background ability.
Imiss-U1025 Dec 19, 2024
c10dd88
Fixed background Color issue on funnel and gauge.
Imiss-U1025 Dec 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ CandleStickChartTmpComp = withViewFn(CandleStickChartTmpComp, (comp) => {
}}
>
<ReactECharts
ref={(e) => (echartsCompRef.current = e)}
style={{ height: "100%" }}
notMerge
lazyUpdate
opts={{ locale: getEchartsLocale() }}
option={option}
theme={mode !== 'map' ? themeConfig : undefined}
mode={mode}
/>
ref={(e) => (echartsCompRef.current = e)}
style={{ height: "100%" }}
notMerge
lazyUpdate
opts={{ locale: getEchartsLocale() }}
option={option}
theme={mode !== 'map' ? themeConfig : undefined}
mode={mode}
/>
</ReactResizeDetector>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export function candleStickChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style?.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
);

const getChatConfigByMode = (mode: string) => {
switch(mode) {
case "json":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { calcXYConfig } from "comps/chartComp/chartConfigs/cartesianAxisConfig";
import Big from "big.js";
import { googleMapsApiUrl } from "../chartComp/chartConfigs/chartUrls";
import { useContext } from "react";
import parseBackground from "../../util/gradientBackgroundColor";

export function transformData(
originData: JSONObject[],
Expand Down Expand Up @@ -136,62 +137,62 @@ export function getEchartsConfig(
): EChartsOptionWithMap {
if (props.mode === "json") {
let opt={
"title": {
"text": props.echartsTitle,
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
"left":"center"
},
"backgroundColor": props?.style?.background || theme?.style?.background,
"color": props.echartsOption.data?.map(data => data.color),
"tooltip": props.tooltip&&{
"trigger": "axis",
"axisPointer": {
"type": "cross"
}
},
"grid": {
"left": "10%",
"right": "10%",
"bottom": "10%",
},
"xAxis": {
"type": "category",
"data": props.echartsOption.xAxis.data
},
"yAxis": {
"type": "value",
"scale": true
},
"series": [
{
"name": props.echartsConfig.type,
"type": props.echartsConfig.type,
"left": "10%",
"top": 60,
"bottom": 60,
"width": "80%",
"min": 0,
"max": 100,
"gap": 2,
"label": {
"show": true,
"position": props.echartsLabelConfig.top
"title": {
"text": props.echartsTitle,
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
"left":"center"
},
"backgroundColor": parseBackground( props?.style?.background || theme?.style?.background || "#FFFFFF"),
"color": props.echartsOption.data?.map(data => data.color),
"tooltip": props.tooltip&&{
"trigger": "axis",
"axisPointer": {
"type": "cross"
}
},
"grid": {
"left": "10%",
"right": "10%",
"bottom": "10%",
},
"xAxis": {
"type": "category",
"data": props.echartsOption.xAxis.data
},
"yAxis": {
"type": "value",
"scale": true
},
"data": props.echartsOption.data,
"series": [
{
"name": props.echartsConfig.type,
"type": props.echartsConfig.type,
"left": "10%",
"top": 60,
"bottom": 60,
"width": "80%",
"min": 0,
"max": 100,
"gap": 2,
"label": {
"show": true,
"position": props.echartsLabelConfig.top
},
"data": props.echartsOption.data,
}
]
}
]
}
return props.echartsOption ? opt : {};

}

if(props.mode === "map") {
const {
mapZoomLevel,
mapCenterLat,
mapCenterLng,
mapOptions,
showCharts,
mapOptions,
showCharts,
} = props;

const echartsOption = mapOptions && showCharts ? mapOptions : {};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {
AlignClose,
AlignRight,
AlignLeft,
dropdownControl,
MultiCompBuilder,
} from "lowcoder-sdk";
import {FunnelSeriesOption, LegendComponentOption} from "echarts";
import { trans } from "i18n/comps";

const FunnelAlignOptions = [
{
label: <AlignLeft />,
value: "left",
},
{
label: <AlignClose />,
value: "center",
},
{
label: <AlignRight />,
value: "right",
}
] as const;

export const EchartsFunnelAlignConfig = (function () {
return new MultiCompBuilder(
{
funnelAlign: dropdownControl(FunnelAlignOptions, "center"),
},
(props): FunnelSeriesOption => {
const config: FunnelSeriesOption = {
funnelAlign: "center",
};
config.funnelAlign = props.funnelAlign
return config;
}
)
.setPropertyViewFn((children) => (
<>
{children.funnelAlign.propertyView({
label: trans("echarts.funnelAlign"),
radioButton: true,
tooltip: trans("echarts.changingAlignTooltip")
})}
</>
))
.build();
})();
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import { LegendComponentOption } from "echarts";
import { trans } from "i18n/comps";

const LabelPositionOptions = [
{
label: <AlignLeft />,
value: "left",
},
{
label: <AlignClose />,
value: "inside",
},
{
label: <AlignRight />,
value: "right",
},
{
label: <AlignLeft />,
value: "left",
},
}
] as const;

export const EchartsLabelConfig = (function () {
Expand All @@ -42,6 +42,7 @@ export const EchartsLabelConfig = (function () {
{children.position.propertyView({
label: trans("echarts.labelPosition"),
radioButton: true,
tooltip: trans("echarts.changingLabelTooltip")
})}
</>
))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {
AlignClose,
AlignRight,
AlignLeft,
dropdownControl,
MultiCompBuilder,
} from "lowcoder-sdk";
import { LegendComponentOption } from "echarts";
import { trans } from "i18n/comps";

const FunnelLegnedAlignOptions = [
{
label: <AlignLeft />,
value: "left",
},
{
label: <AlignClose />,
value: "center",
},
{
label: <AlignRight />,
value: "right",
}
] as const;

export const EchartsLegendAlignConfig = (function () {
return new MultiCompBuilder(
{
left: dropdownControl(FunnelLegnedAlignOptions, "center"),
},
(props): LegendComponentOption => {
const config: LegendComponentOption = {
left: "center",
type: "scroll",
};
config.left = props.left
return config;
}
)
.setPropertyViewFn((children) => (
<>
{children.left.propertyView({
label: trans("echarts.legendAlign"),
radioButton: true,
tooltip: trans("echarts.changingLegend_y_Tooltip")
})}
</>
))
.build();
})();
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const EchartsLegendConfig = (function () {
{children.position.propertyView({
label: trans("echarts.legendPosition"),
radioButton: true,
tooltip: trans("echarts.changingLegend_x_Tooltip")
})}
</>
))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
HorizontalIcon,
VerticalIcon,
dropdownControl,
MultiCompBuilder,
} from "lowcoder-sdk";
import { LegendComponentOption } from "echarts";
import { trans } from "i18n/comps";

const LegendOrientOptions = [
{
label: <HorizontalIcon />,
value: "horizontal",
},
{
label: <VerticalIcon />,
value: "vertical",
},
] as const;

export const EchartsLegendOrientConfig = (function () {
return new MultiCompBuilder(
{
orient: dropdownControl(LegendOrientOptions, "horizontal"),
},
(props): LegendComponentOption => {
const config: LegendComponentOption = {
orient: "horizontal",
type: "scroll"
};
config.orient = props.orient
return config;
}
)
.setPropertyViewFn((children) => (
<>
{children.orient.propertyView({
label: trans("echarts.legendOrient"),
radioButton: true,
tooltip: trans("echarts.changingLegend_orient_Tooltip")
})}
</>
))
.build();
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {
AlignBottom,
AlignTop,
dropdownControl,
MultiCompBuilder,
} from "lowcoder-sdk";
import {FunnelSeriesOption, LegendComponentOption} from "echarts";
import { trans } from "i18n/comps";

const SortingOptions = [
{
label: <AlignBottom />,
value: "descending",
},
{
label: <AlignTop />,
value: "ascending",
},
] as const;

export const EchartsSortingConfig = (function () {
return new MultiCompBuilder(
{
sort: dropdownControl(SortingOptions, "descending"),
},
(props): FunnelSeriesOption => {
const config: FunnelSeriesOption = {
sort: "descending"
};
config.sort = props.sort
return config;
}
)
.setPropertyViewFn((children) => (
<>
{children.sort.propertyView({
label: trans("echarts.sort"),
radioButton: true,
tooltip: trans("echarts.changingSortTooltip")
})}
</>
))
.build();
})();
Loading
Loading