Skip to content
Merged
Prev Previous commit
Next Next commit
Added additional data input and moved options to Advanced.
  • Loading branch information
Imiss-U1025 committed Jan 19, 2025
commit 712dae0202f6bb27f5ef51430e8b6df213f9c2b4
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export const chartUiModeChildren = {
};

let chartJsonModeChildren: any = {
echartsData: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export function chartPropertyView(
const uiModePropertyView = (
<>
<Section name={trans("chart.data")}>
{children.data.propertyView({
label: trans("chart.data"),
})}
{children.echartsData.propertyView({ label: trans("chart.data") })}
<Dropdown
value={children.chartConfig.children.compType.getView()}
options={ChartTypeOptions}
Expand Down Expand Up @@ -151,6 +149,11 @@ export function chartPropertyView(
<Section name={sectionNames.legendStyle}>
{children.legendStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.advanced}>
{children.data.propertyView({
label: trans("chart.data"),
})}
</Section>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export const chartUiModeChildren = {
};

let chartJsonModeChildren: any = {
echartsData: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
echartsOption: jsonControl(toObject, i18nObjs.defaultCandleStickChartOption),
echartsTitle: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,7 @@ export function candleStickChartPropertyView(
const jsonModePropertyView = (
<>
<Section name={trans("chart.config")}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
tooltip: (
<div>
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionTooltip")}
</a>
<br />
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionExamples")}
</a>
</div>
),
})}
{children.echartsData.propertyView({ label: trans("chart.data") })}
{children.echartsTitleConfig.getPropertyView()}
{children.echartsTitleVerticalConfig.getPropertyView()}
{children.echartsTitle.propertyView({ label: trans("candleStickChart.title"), tooltip: trans("echarts.titleTooltip") })}
Expand Down Expand Up @@ -61,6 +47,23 @@ export function candleStickChartPropertyView(
<Section name={sectionNames.yAxisStyle}>
{children.yAxisStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.advanced}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
tooltip: (
<div>
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionTooltip")}
</a>
<br />
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionExamples")}
</a>
</div>
),
})}
</Section>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export const chartUiModeChildren = {
};

let chartJsonModeChildren: any = {
echartsData: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ export function chartPropertyView(
const uiModePropertyView = (
<>
<Section name={trans("chart.data")}>
{children.data.propertyView({
label: trans("chart.data"),
})}
{children.echartsData.propertyView({ label: trans("chart.data") })}
<Dropdown
value={children.chartConfig.children.compType.getView()}
options={ChartTypeOptions}
Expand Down Expand Up @@ -151,6 +149,11 @@ export function chartPropertyView(
<Section name={sectionNames.legendStyle}>
{children.legendStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.advanced}>
{children.data.propertyView({
label: trans("chart.data"),
})}
</Section>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export const chartUiModeChildren = {
};

let chartJsonModeChildren: any = {
echartsData: withDefault(StringControl, trans("funnelChart.defaultTitle")),
echartsOption: jsonControl(toObject, i18nObjs.defaultFunnelChartOption),
echartsTitle: withDefault(StringControl, trans("funnelChart.defaultTitle")),
echartsTitleVerticalConfig: EchartsTitleVerticalConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,8 @@ export function funnelChartPropertyView(
const jsonModePropertyView = (
<>
<Section name={trans("chart.config")}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
tooltip: (
<div>
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionTooltip")}
</a>
<br />
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionExamples")}
</a>
</div>
),
})}
{children.echartsData.propertyView({ label: trans("chart.data") })}

{children.echartsTitleConfig.getPropertyView()}
{children.echartsTitleVerticalConfig.getPropertyView()}
{children.legendVisibility.getView() && children.echartsLegendAlignConfig.getPropertyView()}
Expand Down Expand Up @@ -74,6 +61,23 @@ export function funnelChartPropertyView(
</Section> : <></>
}
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
<Section name={sectionNames.advanced}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
tooltip: (
<div>
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionTooltip")}
</a>
<br />
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionExamples")}
</a>
</div>
),
})}
</Section>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function getEchartsConfig(
"left": props.echartsLegendAlignConfig.left,
"orient": props.echartsLegendOrientConfig.orient,
"textStyle": {
...styleWrapper(props?.legendStyle, theme?.legendStyle)
...styleWrapper(props?.legendStyle, theme?.legendStyle, 13)
}
},
"series": [
Expand All @@ -182,7 +182,7 @@ export function getEchartsConfig(
"label": {
"show": props.label,
"position": props.echartsLabelConfig.top,
...styleWrapper(props?.labelStyle,theme?.labelStyle),
...styleWrapper(props?.labelStyle,theme?.labelStyle, 13),
},
"data": props.echartsOption.data
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export const chartUiModeChildren = {
};

let chartJsonModeChildren: any = {
echartsData: withDefault(StringControl, trans("funnelChart.defaultTitle")),
echartsOption: jsonControl(toObject, i18nObjs.defaultGaugeChartOption),
stageGaugeOption: jsonControl(toObject, i18nObjs.defaultStageGaugeChartOption),
gradeGaugeOption: jsonControl(toObject, i18nObjs.defaultGradeGaugeChartOption),
Expand All @@ -277,6 +278,14 @@ let chartJsonModeChildren: any = {
clockGaugeOption: jsonControl(toObject, i18nObjs.defaultClockGaugeChartOption),
barometerGaugeOption: jsonControl(toObject, i18nObjs.defaultBarometerGaugeChartOption),

stageGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
gradeGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
temperatureGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
multiTitleGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
ringGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
clockGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),
barometerGaugeData:withDefault(StringControl, trans("gaugeChart.defaultTitle")),

chartType: dropdownControl(ChartTypeOptions, trans("chart.default")),
echartsTitle: withDefault(StringControl, trans("gaugeChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
Expand Down
Loading