Skip to content

Commit bb05f31

Browse files
committed
fix: update based on comments
1 parent 9744a51 commit bb05f31

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

src/components/chart/vegaLiteChart/vegaLiteChart.stories.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export const BarChart = {
5252
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
5353
width: 'container',
5454
height: 'container',
55-
title: 'Bar Chart Title',
5655
data: {
5756
values: [
5857
{ a: 'A', b: 28 },
@@ -112,27 +111,36 @@ export const WithTitleAndDescription = {
112111
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
113112
width: 'container',
114113
height: 'container',
114+
title: 'Number of Orders by Product',
115+
description:
116+
'This chart shows the number of orders by product in the last month.',
115117
data: {
116118
values: [
117-
{ a: 'A', b: 28 },
118-
{ a: 'B', b: 55 },
119-
{ a: 'C', b: 43 },
120-
{ a: 'D', b: 91 },
121-
{ a: 'E', b: 81 },
122-
{ a: 'F', b: 53 },
123-
{ a: 'G', b: 19 },
124-
{ a: 'H', b: 87 },
125-
{ a: 'I', b: 52 },
119+
{ product: 'a', orders: 40 },
120+
{ product: 'b', orders: 55 },
121+
{ product: 'c', orders: 43 },
122+
{ product: 'd', orders: 91 },
123+
{ product: 'e', orders: 81 },
124+
{ product: 'f', orders: 53 },
126125
],
127126
},
128127
mark: 'bar',
129128
encoding: {
130-
x: { field: 'a', type: 'nominal', axis: { labelAngle: 0 } },
131-
y: { field: 'b', type: 'quantitative' },
129+
x: {
130+
field: 'product',
131+
type: 'nominal',
132+
axis: { labelAngle: 0 },
133+
},
134+
y: {
135+
field: 'orders',
136+
type: 'quantitative',
137+
axis: { title: 'Orders(in thousands)' },
138+
},
132139
},
133140
},
134-
title: 'Bar Chart Title',
135-
description: 'This chart shows the bar chart with title and description',
141+
title: 'Product Order Volumes for X Company',
142+
description:
143+
"The chart below illustrates the distribution of orders across different products in the last month for X Company. Each product's order count is displayed in thousands, providing a clear comparison of product performance.",
136144
},
137145
decorators,
138146
}

src/components/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ type VegaLiteOptions = EmbedOptions<string, Renderers>
142142
export interface VegaLiteChartFormat extends DataFormat {
143143
/** Follow Vega-lite's [documentation](https://vega.github.io/vega-lite/) to provide a specification object. Schema should be included in the spec. Need to use 'container' for width or height for responsive chart. */
144144
spec: VisualizationSpec
145-
theme?: {
145+
theme: {
146146
light?: VegaLiteOptions['theme']
147-
dark?: VegaLiteOptions['theme']
147+
dark: VegaLiteOptions['theme']
148148
}
149149
options?: VegaLiteOptions
150150
}

0 commit comments

Comments
 (0)