UNPKG

devexpress-reporting

Version:

DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.

39 lines (38 loc) 1.54 kB
/** * DevExpress HTML/JS Reporting (chart\internal\chartStructure\_provider.js) * Version: 25.1.3 * Build date: Jun 26, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ import { ObjectStructureProvider } from '@devexpress/analytics-core/analytics-internal'; import * as ko from 'knockout'; import { SecondaryAxisViewModel } from '../../components/axis/_secondaryAxisViewModel'; import { SeriesViewModel } from '../../components/series/_series'; export class ChartStructureObjectProvider extends ObjectStructureProvider { getClassName(instance) { if (instance instanceof SeriesViewModel) { return 'SeriesViewModel'; } else if (instance instanceof SecondaryAxisViewModel) { return 'SecondaryAxisViewModel'; } else { return super.getClassName(instance); } } createArrayItem(currentTarget, result, propertyName) { super.createArrayItem(currentTarget, result, propertyName); for (let i = 0; i < result.length; i++) { const item = result[i]; if (item.specifics === 'SeriesViewModel') { const unwrapArrayValue = ko.unwrap(currentTarget[i]); result[i].dragData = { noDragable: false }; result[i]['data'] = unwrapArrayValue; } } } constructor(target, displayName, localizationId) { super(target, displayName, localizationId); } }