I implemented it already but two secondary axis are occurring but I wanted two secondary should be one axis.
This is my onFirstDataRender
code that I implemented for combine tow chart.
const onFirstDataRendered = useCallback((params: FirstDataRenderedEvent) => {
params.api.createRangeChart({
chartType: "customCombo",
cellRange: {
columns: ["month", "rain", "pressure", "temp"],
},
seriesChartTypes: [
{ colId: "rain", chartType: "groupedColumn", secondaryAxis: true },
{ colId: "pressure", chartType: "line", secondaryAxis: true },
{ colId: "temp", chartType: "line", secondaryAxis: true },
],
aggFunc: "sum",
suppressChartRanges: true,
chartContainer: document.querySelector("#myChart") as any,
});
}, []);
const chartThemeOverrides = useMemo<AgChartThemeOverrides>(() => {
return {
common: {
axes: {
number: {
title: {
enabled: true,
formatter: (params: AgAxisCaptionFormatterParams) => {
return params.boundSeries.map((s) => s.name).join(" / ");
},
},
},
},
},
bar: {
series: {
strokeWidth: 2,
fillOpacity: 0.8,
},
},
line: {
series: {
strokeWidth: 5,
strokeOpacity: 0.8,
marker: {
enabled: false,
},
},
},
};
}, []);
and I also provide that chartThemeOverrides
where axis are made. but in this temp and pressure has there separate axis on the right side but I wanted to combine both axis to only one axis for both of the line chart on the right side.
My expectation is I wanted rain axis on left side and both line chart temp and pressure should has only one secondary axis on the right side so both temp and pressure should depend on one secondary axis on right side.
sachuuu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.