Skip to content

Commit

Permalink
Merge pull request #158 from zimmerman-team/feat/DX-1531
Browse files Browse the repository at this point in the history
feat: DX-1531, DX-1530, DX-1528
  • Loading branch information
okorie2 authored Jun 10, 2024
2 parents 0e184f9 + 6e73abd commit dd92182
Showing 1 changed file with 94 additions and 3 deletions.
97 changes: 94 additions & 3 deletions src/app/hooks/useDataThemesEchart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function useDataThemesEchart() {
marginBottom,
marginLeft,
realTimeSort,
color,
barColor,
splitLineY,
barRadius,
barWidth,
Expand All @@ -85,6 +85,7 @@ export function useDataThemesEchart() {
showTooltip,
isMonetaryValue,
label,
dataZoom,
} = visualOptions;

const sortedData = sortBy(data, (d) => d.bars);
Expand Down Expand Up @@ -126,7 +127,23 @@ export function useDataThemesEchart() {
show: splitLineY ?? true,
},
name: mapping?.size?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
{
type: "inside",
start: 0,
end: 20,
},
{
start: 0,
end: 20,
},
]
: null,
// xAxis: orientation === "horizontal" ? { type: "value" } : { data: bars },
// yAxis: orientation === "vertical" ? { type: "value" } : { data: bars },
// backgroundColor: background,
Expand All @@ -139,7 +156,7 @@ export function useDataThemesEchart() {
data: sizes,
realtimeSort: realTimeSort ?? true,
itemStyle: {
color: color,
color: barColor,
borderRadius: barRadius,
},
emphasis: {
Expand Down Expand Up @@ -354,6 +371,7 @@ export function useDataThemesEchart() {
marginLeft,
// chart options
showLegend,
dataZoom,
// Tooltip
showTooltip,
isMonetaryValue,
Expand All @@ -380,7 +398,23 @@ export function useDataThemesEchart() {
zlevel: -1,
z: -1,
name: mapping?.y?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
{
type: "inside",
start: 0,
end: 20,
},
{
start: 0,
end: 20,
},
]
: null,
legend: {
show: showLegend,
data: filter(
Expand Down Expand Up @@ -426,9 +460,10 @@ export function useDataThemesEchart() {
// Tooltip
showTooltip,
isMonetaryValue,
dataZoom,
// Palette
palette,
// chart options
dataZoom,
} = visualOptions;

const convertedData = sortBy(data, (d) => d.x).map((d: any) => [
Expand Down Expand Up @@ -466,6 +501,9 @@ export function useDataThemesEchart() {
type: "value",
boundaryGap: [0, "100%"],
name: mapping?.y?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
Expand Down Expand Up @@ -504,6 +542,7 @@ export function useDataThemesEchart() {
marginLeft,
// chart options
showLegend,
dataZoom,
// Tooltip
showTooltip,
isMonetaryValue,
Expand Down Expand Up @@ -535,7 +574,23 @@ export function useDataThemesEchart() {
zlevel: -1,
z: -1,
name: mapping?.y?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
{
type: "inside",
start: 0,
end: 20,
},
{
start: 0,
end: 20,
},
]
: null,
legend: {
show: showLegend,
data: filter(
Expand Down Expand Up @@ -589,6 +644,8 @@ export function useDataThemesEchart() {
labelFontSize,
// Palette
palette,
// chart
dataZoom,
} = visualOptions;
const groups = Object.keys(data);

Expand Down Expand Up @@ -630,7 +687,23 @@ export function useDataThemesEchart() {
},
scale: true,
name: mapping?.y?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
{
type: "inside",
start: 0,
end: 20,
},
{
start: 0,
end: 20,
},
]
: null,
tooltip: {
trigger: showTooltip ? "item" : "none",
confine: true,
Expand Down Expand Up @@ -690,6 +763,8 @@ export function useDataThemesEchart() {
symbolSize,
// Palette
palette,
// chart
dataZoom,
} = visualOptions;

const option = {
Expand All @@ -711,7 +786,23 @@ export function useDataThemesEchart() {
],
yAxis: {
name: mapping?.y?.value?.[0] ?? "",
nameTextStyle: {
align: "left",
},
},
dataZoom: dataZoom
? [
{
type: "inside",
start: 0,
end: 20,
},
{
start: 0,
end: 20,
},
]
: null,
tooltip: {
trigger: showTooltip ? "item" : "none",
confine: true,
Expand Down

0 comments on commit dd92182

Please sign in to comment.