Skip to content

Commit

Permalink
AG-12978 Update normalised stacked area test data
Browse files Browse the repository at this point in the history
  • Loading branch information
lsjroberts committed Dec 4, 2024
1 parent e6885da commit adcd1e0
Show file tree
Hide file tree
Showing 9 changed files with 243 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ const EXAMPLES: Record<string, CartesianOrPolarTestCase & { skip?: boolean }> =
options: examples.NORMALISED_STACKED_AREA,
assertions: cartesianChartAssertions({ axisTypes: ['category', 'number'], seriesTypes: repeat('area', 4) }),
},
NORMALISED_STACKED_AREA_WITH_ZEROES: {
options: examples.NORMALISED_STACKED_AREA_WITH_ZEROES,
assertions: cartesianChartAssertions({ axisTypes: ['category', 'number'], seriesTypes: repeat('area', 4) }),
},
NORMALISED_STACKED_AREA_CONNECTED: {
options: examples.NORMALISED_STACKED_AREA_CONNECTED,
assertions: cartesianChartAssertions({ axisTypes: ['category', 'number'], seriesTypes: repeat('area', 4) }),
},
}),
};

Expand Down
128 changes: 118 additions & 10 deletions packages/ag-charts-community/src/chart/test/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export const DATA_BROWSER_MARKET_SHARE_MISSING_X = [
ie: 54.39,
firefox: 31.15,
safari: 4.22,
chrome: undefined,
chrome: 4.67,
},
{
year: '2011',
Expand All @@ -377,50 +377,158 @@ export const DATA_BROWSER_MARKET_SHARE_MISSING_X = [
},
{
year: '2013',
ie: 26.55,
firefox: 18.55,
safari: 10.66,
chrome: 31.71,
},
{
year: '2014',
ie: undefined,
firefox: undefined,
safari: undefined,
chrome: undefined,
},
{
year: '2015',
ie: 13.3,
firefox: 11.82,
safari: 13.79,
chrome: 42.27,
},
{
year: '2016',
ie: 8.94,
firefox: 8.97,
safari: 12.9,
chrome: 47.79,
},
{
year: '2017',
ie: undefined,
firefox: 6.75,
safari: 14.54,
chrome: 51.76,
},
{
year: '2018',
ie: undefined,
firefox: 5.66,
safari: 14.44,
chrome: 56.31,
},
{
year: '2019',
ie: undefined,
firefox: 3.43,
safari: 15.23,
chrome: 61.72,
},
{
year: '2020',
ie: 3.2,
firefox: 4.27,
safari: 15.23,
chrome: 61.72,
},
{
year: '2021',
ie: 2.7,
firefox: 3.98,
safari: 15.23,
chrome: 61.72,
},
];

export const DATA_BROWSER_MARKET_SHARE_ZEROES_X = [
{
year: '2009',
ie: 64.97,
firefox: 26.85,
safari: 2.79,
chrome: 1.37,
},
{
year: '2010',
ie: 54.39,
firefox: 31.15,
safari: 4.22,
chrome: 4.67,
},
{
year: '2011',
ie: 44.03,
firefox: 0,
safari: 5.94,
chrome: 15.01,
},
{
year: '2012',
ie: 34.27,
firefox: 22.69,
safari: 8.09,
chrome: 25.99,
},
{
year: '2013',
ie: 26.55,
firefox: 18.55,
safari: 10.66,
chrome: 31.71,
},
{
year: '2014',
ie: 17.75,
firefox: 14.77,
safari: 12.63,
chrome: 35.85,
ie: 0,
firefox: 0,
safari: 0,
chrome: 0,
},
{
year: '2015',
ie: undefined,
ie: 13.3,
firefox: 11.82,
safari: 13.79,
chrome: 42.27,
},
{
year: '2016',
ie: undefined,
ie: 8.94,
firefox: 8.97,
safari: 12.9,
chrome: 47.79,
},
{
year: '2017',
ie: undefined,
ie: 0,
firefox: 6.75,
safari: 14.54,
chrome: 51.76,
},
{
year: '2018',
ie: 3.2,
ie: 0,
firefox: 5.66,
safari: 14.44,
chrome: 56.31,
},
{
year: '2019',
ie: 0,
firefox: 3.43,
safari: 15.23,
chrome: 61.72,
},
{
year: '2020',
ie: 3.2,
firefox: 4.27,
safari: 15.23,
chrome: 61.72,
},
{
year: '2021',
ie: 2.7,
firefox: 4.66,
firefox: 3.98,
safari: 15.23,
chrome: 61.72,
},
Expand Down
117 changes: 117 additions & 0 deletions packages/ag-charts-community/src/chart/test/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DATA_BROWSER_MARKET_SHARE,
DATA_BROWSER_MARKET_SHARE_MISSING_FIRST_Y,
DATA_BROWSER_MARKET_SHARE_MISSING_X,
DATA_BROWSER_MARKET_SHARE_ZEROES_X,
DATA_INTERNET_EXPLORER_MARKET_SHARE_BAD_Y_VALUE,
DATA_MEAN_SEA_LEVEL,
DATA_MISSING_X,
Expand Down Expand Up @@ -2264,6 +2265,122 @@ export const NORMALISED_STACKED_AREA: AgCartesianChartOptions = {
],
};

export const NORMALISED_STACKED_AREA_WITH_ZEROES: AgCartesianChartOptions = {
data: DATA_BROWSER_MARKET_SHARE_ZEROES_X,
series: [
{
type: 'area',
xKey: 'year',
yKey: 'ie',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'firefox',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'safari',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'chrome',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
},
],
axes: [
{
type: 'category',
position: 'bottom',
},
{
type: 'number',
position: 'left',
},
],
};

export const NORMALISED_STACKED_AREA_CONNECTED: AgCartesianChartOptions = {
data: DATA_BROWSER_MARKET_SHARE_MISSING_X,
series: [
{
type: 'area',
xKey: 'year',
yKey: 'ie',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
connectMissingData: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'firefox',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
connectMissingData: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'safari',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
connectMissingData: true,
},
{
type: 'area',
xKey: 'year',
yKey: 'chrome',
marker: {
size: 5,
},
normalizedTo: 100,
stacked: true,
connectMissingData: true,
},
],
axes: [
{
type: 'category',
position: 'bottom',
},
{
type: 'number',
position: 'left',
},
],
};

export const LINE_TIME_X_AXIS_NUMBER_Y_AXIS: AgCartesianChartOptions = {
axes: [
{
Expand Down

0 comments on commit adcd1e0

Please sign in to comment.