UNPKG

devexpress-reporting

Version:

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

70 lines (69 loc) 18.4 kB
/** * DevExpress HTML/JS Reporting (chart\internal\meta\_series.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 { extend } from '@devexpress/analytics-core/analytics-internal'; import { colorFromString, colorToString, getLocalization, parseBool } from '@devexpress/analytics-core/analytics-utils'; import { editorTemplates } from '@devexpress/analytics-core/analytics-widgets'; import { editorTemplates as chartEditorTemplates } from '../_editorTemplates'; import { antialiasing, backColor, color, defaultBooleanValues, font8, maxLineCount, maxWidth, tag, textAlignment, textColor, textPattern, thickness, typeNameNotShow, visibility } from './_common'; export const typeNameSerializable = { propertyName: 'typeName', modelName: '@TypeNameSerializable', from: (value) => { return value; } }; export const barSeriesViewGroup = ['SideBySideBarSeriesView', 'StackedBarSeriesView', 'FullStackedBarSeriesView', 'SideBySideStackedBarSeriesView', 'SideBySideFullStackedBarSeriesView', 'OverlappedRangeBarSeriesView', 'SideBySideRangeBarSeriesView', 'OverlappedGanttSeriesView', 'SideBySideGanttSeriesView']; export const bar3DSeriesViewGroup = ['SideBySideBar3DSeriesView', 'StackedBar3DSeriesView', 'FullStackedBar3DSeriesView', 'SideBySideStackedBar3DSeriesView', 'SideBySideFullStackedBar3DSeriesView', 'ManhattanBarSeriesView']; export const barWidth = { propertyName: 'barWidth', modelName: '@BarWidth', displayName: 'Bar Width', defaultVal: 0.6, editor: editorTemplates.getEditor('numeric'), localizationId: 'DevExpress.XtraCharts.BarSeriesView.BarWidth' }; export const colorEach = { propertyName: 'colorEach', modelName: '@ColorEach', displayName: 'Color Each', defaultVal: false, editor: editorTemplates.getEditor('bool'), from: parseBool, localizationId: 'DevExpress.XtraCharts.SeriesView3DColorEachSupportBase.ColorEach' }; export const borderSerializationsInfo = [color, thickness, visibility]; export const border = { propertyName: 'border', modelName: 'Border', displayName: 'Border', info: borderSerializationsInfo, defaultVal: {}, editor: editorTemplates.getEditor('objecteditor'), localizationId: 'DevExpress.XtraCharts.TotalLabel.Border' }; const color2 = { propertyName: 'color2', modelName: '@Color2', displayName: 'Color2', from: colorFromString, toJsonObject: colorToString, editor: editorTemplates.getEditor('customColorEditor'), localizationId: 'DevExpress.XtraCharts.PaletteEntry.Color2' }, typeNameSerializableOptions = { propertyName: 'typeNameSerializable', modelName: '@TypeNameSerializable' }; export const fillMode = { propertyName: 'fillMode', modelName: '@FillMode', displayName: 'Fill Mode', defaultVal: 'Empty', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Empty', displayValue: 'Empty', localizationId: 'DevExpress.XtraPivotGrid.PivotGridAppearances.Empty' }, { value: 'Solid', displayValue: 'Solid', localizationId: 'DevExpress.XtraCharts.FillMode3D.Solid' }, { value: 'Gradient', displayValue: 'Gradient', localizationId: 'DevExpress.XtraCharts.FillMode3D.Gradient' }, { value: 'Hatch', displayValue: 'Hatch', localizationId: 'DevExpress.XtraCharts.FillMode.Hatch' }], localizationId: 'DevExpress.XtraCharts.FillStyle3D.FillMode' }; const gradientModeBase = { propertyName: 'gradientMode', modelName: '@GradientMode', displayName: 'Gradient Mode', defaultVal: 'TopToBottom', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'TopToBottom', displayValue: 'Top To Bottom', localizationId: 'DevExpress.XtraCharts.TextOrientation.TopToBottom' }, { value: 'BottomToTop', displayValue: 'Bottom To Top', localizationId: 'DevExpress.XtraCharts.TextOrientation.BottomToTop' }, { value: 'LeftToRight', displayValue: 'Left To Right' }, { value: 'RightToLeft', displayValue: 'Right To Left' }, { value: 'TopLeftToBottomRight', displayValue: 'Top Left To Bottom Right' }, { value: 'BottomRightToTopLeft', displayValue: 'Bottom Right To Top Left' }, { value: 'TopRightToBottomLeft', displayValue: 'Top Right To Bottom Left' }, { value: 'BottomLeftToTopRight', displayValue: 'Bottom Left To Top Right' }, { value: 'FromCenterHorizontal', displayValue: 'From Center Horizontal', localizationId: 'DevExpress.XtraCharts.RectangleGradientMode.FromCenterHorizontal' }, { value: 'ToCenterHorizontal', displayValue: 'To Center Horizontal', localizationId: 'DevExpress.XtraCharts.RectangleGradientMode.ToCenterHorizontal' }, { value: 'FromCenterVertical', displayValue: 'From Center Vertical', localizationId: 'DevExpress.XtraCharts.RectangleGradientMode.FromCenterVertical' }, { value: 'ToCenterVertical', displayValue: 'To Center Vertical', localizationId: 'DevExpress.XtraCharts.RectangleGradientMode.ToCenterVertical' }], localizationId: 'DevExpress.XtraCharts.PolygonGradientFillOptions.GradientMode' }, GradientFillOptionsInfoBase = [gradientModeBase, color2, tag, { propertyName: 'typeNameSerializable', modelName: '@TypeNameSerializable' }]; const hatchStyle = { propertyName: 'hatchStyle', modelName: '@HatchStyle', displayName: 'Hatch Style', defaultVal: 'BackwardDiagonal', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Horizontal', displayValue: 'Horizontal', localizationId: 'DevExpress.XtraCharts.TextOrientation.Horizontal' }, { value: 'Vertical', displayValue: 'Vertical', localizationId: 'DevExpress.XtraCharts.LayoutDirection.Vertical' }, { value: 'ForwardDiagonal', displayValue: 'ForwardDiagonal', localizationId: 'ChartStringId.WizHatchForwardDiagonal' }, { value: 'BackwardDiagonal', displayValue: 'BackwardDiagonal', localizationId: 'ChartStringId.WizHatchBackwardDiagonal' }, { value: 'LargeGrid', displayValue: 'LargeGrid', localizationId: 'ChartStringId.WizHatchLargeGrid' }, { value: 'DiagonalCross', displayValue: 'DiagonalCross', localizationId: 'ChartStringId.WizHatchDiagonalCross' }, { value: 'Percent05', displayValue: 'Percent05', localizationId: 'ChartStringId.WizHatchPercent05' }, { value: 'Percent10', displayValue: 'Percent10', localizationId: 'ChartStringId.WizHatchPercent10' }, { value: 'Percent20', displayValue: 'Percent20', localizationId: 'ChartStringId.WizHatchPercent20' }, { value: 'Percent25', displayValue: 'Percent25', localizationId: 'ChartStringId.WizHatchPercent25' }, { value: 'Percent30', displayValue: 'Percent30', localizationId: 'ChartStringId.WizHatchPercent30' }, { value: 'Percent40', displayValue: 'Percent40', localizationId: 'ChartStringId.WizHatchPercent40' }, { value: 'Percent50', displayValue: 'Percent50', localizationId: 'ChartStringId.WizHatchPercent50' }, { value: 'Percent60', displayValue: 'Percent60', localizationId: 'ChartStringId.WizHatchPercent60' }, { value: 'Percent70', displayValue: 'Percent70', localizationId: 'ChartStringId.WizHatchPercent70' }, { value: 'Percent75', displayValue: 'Percent75', localizationId: 'ChartStringId.WizHatchPercent75' }, { value: 'Percent80', displayValue: 'Percent80', localizationId: 'ChartStringId.WizHatchPercent80' }, { value: 'Percent90', displayValue: 'Percent90', localizationId: 'ChartStringId.WizHatchPercent90' }, { value: 'LightDownwardDiagonal', displayValue: 'LightDownwardDiagonal', localizationId: 'ChartStringId.WizHatchLightDownwardDiagonal' }, { value: 'LightUpwardDiagonal', displayValue: 'LightUpwardDiagonal', localizationId: 'ChartStringId.WizHatchLightUpwardDiagonal' }, { value: 'DarkDownwardDiagonal', displayValue: 'DarkDownwardDiagonal', localizationId: 'ChartStringId.WizHatchDarkDownwardDiagonal' }, { value: 'DarkUpwardDiagonal', displayValue: 'DarkUpwardDiagonal', localizationId: 'ChartStringId.WizHatchDarkUpwardDiagonal' }, { value: 'WideDownwardDiagonal', displayValue: 'WideDownwardDiagonal', localizationId: 'ChartStringId.WizHatchWideDownwardDiagonal' }, { value: 'WideUpwardDiagonal', displayValue: 'WideUpwardDiagonal', localizationId: 'ChartStringId.WizHatchWideUpwardDiagonal' }, { value: 'LightVertical', displayValue: 'LightVertical', localizationId: 'ChartStringId.WizHatchLightVertical' }, { value: 'LightHorizontal', displayValue: 'LightHorizontal', localizationId: 'ChartStringId.WizHatchLightHorizontal' }, { value: 'NarrowVertical', displayValue: 'NarrowVertical', localizationId: 'ChartStringId.WizHatchNarrowVertical' }, { value: 'NarrowHorizontal', displayValue: 'NarrowHorizontal', localizationId: 'ChartStringId.WizHatchNarrowHorizontal' }, { value: 'DarkVertical', displayValue: 'DarkVertical', localizationId: 'ChartStringId.WizHatchDarkVertical' }, { value: 'DarkHorizontal', displayValue: 'DarkHorizontal', localizationId: 'ChartStringId.WizHatchDarkHorizontal' }, { value: 'DashedDownwardDiagonal', displayValue: 'DashedDownwardDiagonal', localizationId: 'ChartStringId.WizHatchDashedDownwardDiagonal' }, { value: 'DashedUpwardDiagonal', displayValue: 'DashedUpwardDiagonal', localizationId: 'ChartStringId.WizHatchDashedUpwardDiagonal' }, { value: 'DashedHorizontal', displayValue: 'DashedHorizontal', localizationId: 'ChartStringId.WizHatchDashedHorizontal' }, { value: 'DashedVertical', displayValue: 'DashedVertical', localizationId: 'ChartStringId.WizHatchDashedVertical' }, { value: 'SmallConfetti', displayValue: 'SmallConfetti', localizationId: 'ChartStringId.WizHatchSmallConfetti' }, { value: 'LargeConfetti', displayValue: 'LargeConfetti', localizationId: 'ChartStringId.WizHatchLargeConfetti' }, { value: 'ZigZag', displayValue: 'ZigZag', localizationId: 'ChartStringId.WizHatchZigZag' }, { value: 'Wave', displayValue: 'Wave', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Wave' }, { value: 'DiagonalBrick', displayValue: 'DiagonalBrick', localizationId: 'ChartStringId.WizHatchDiagonalBrick' }, { value: 'HorizontalBrick', displayValue: 'HorizontalBrick', localizationId: 'ChartStringId.WizHatchHorizontalBrick' }, { value: 'Weave', displayValue: 'Weave', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Weave' }, { value: 'Plaid', displayValue: 'Plaid', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Plaid' }, { value: 'Divot', displayValue: 'Divot', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Divot' }, { value: 'DottedGrid', displayValue: 'DottedGrid', localizationId: 'ChartStringId.WizHatchDottedGrid' }, { value: 'DottedDiamond', displayValue: 'DottedDiamond', localizationId: 'ChartStringId.WizHatchDottedDiamond' }, { value: 'Shingle', displayValue: 'Shingle', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Shingle' }, { value: 'Trellis', displayValue: 'Trellis', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Trellis' }, { value: 'Sphere', displayValue: 'Sphere', localizationId: 'System.Drawing.Drawing2D.HatchStyle.Sphere' }, { value: 'SmallGrid', displayValue: 'SmallGrid', localizationId: 'ChartStringId.WizHatchSmallGrid' }, { value: 'SmallCheckerBoard', displayValue: 'SmallCheckerBoard', localizationId: 'ChartStringId.WizHatchSmallCheckerBoard' }, { value: 'LargeCheckerBoard', displayValue: 'LargeCheckerBoard', localizationId: 'ChartStringId.WizHatchLargeCheckerBoard' }, { value: 'OutlinedDiamond', displayValue: 'OutlinedDiamond', localizationId: 'ChartStringId.WizHatchOutlinedDiamond' }, { value: 'SolidDiamond', displayValue: 'SolidDiamond', localizationId: 'ChartStringId.WizHatchSolidDiamond' }], localizationId: 'DevExpress.XtraCharts.HatchFillOptions.HatchStyle' }, hatchFillOptionsInfo = [hatchStyle, color2, tag, typeNameSerializableOptions]; export const fillStyleOptionsSerialize = { propertyName: 'options', modelName: 'Options', displayName: 'Options', editor: editorTemplates.getEditor('objecteditor'), localizationId: 'DevExpress.XtraPivotGrid.PivotGridFieldBase.Options' }; export const fillMode3D = { propertyName: 'fillMode', modelName: '@FillMode', displayName: 'Fill Mode', defaultVal: 'Empty', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Empty', displayValue: 'Empty', localizationId: 'DevExpress.XtraPivotGrid.PivotGridAppearances.Empty' }, { value: 'Solid', displayValue: 'Solid', localizationId: 'DevExpress.XtraCharts.FillMode3D.Solid' }, { value: 'Gradient', displayValue: 'Gradient', localizationId: 'DevExpress.XtraCharts.FillMode3D.Gradient' }], localizationId: 'DevExpress.XtraCharts.FillStyle3D.FillMode' }; export const fillStyle = { propertyName: 'fillStyle', modelName: 'FillStyle', displayName: 'Fill Style', editor: editorTemplates.getEditor('objecteditor'), localizationId: 'DevExpress.XtraReports.UI.XRChart.FillStyle' }; const seriesAggregateFunction = { propertyName: 'aggregateFunction', modelName: '@AggregateFunction', displayName: 'Aggregate Function', localizationId: 'DevExpress.XtraCharts.XYDiagram2DSeriesViewBase.AggregateFunction', defaultVal: 'Default', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Default', displayValue: getLocalization('Default', 'ChartStringId.WizAggregateFunctionDefault') }, { value: 'None', displayValue: getLocalization('None', 'ChartStringId.WizAggregateFunctionNone') }, { value: 'Average', displayValue: getLocalization('Average', 'ChartStringId.WizAggregateFunctionAverage') }, { value: 'Sum', displayValue: getLocalization('Sum', 'ChartStringId.WizAggregateFunctionSum') }, { value: 'Minimum', displayValue: getLocalization('Minimum', 'ChartStringId.WizAggregateFunctionMinimum') }, { value: 'Maximum', displayValue: getLocalization('Maximum', 'ChartStringId.WizAggregateFunctionMaximum') }, { value: 'Count', displayValue: getLocalization('Count', 'ChartStringId.WizAggregateFunctionCount') }, { value: 'Financial', displayValue: getLocalization('Financial', 'ChartStringId.WizAggregateFunctionFinancial') }] }; export const viewSerializationsInfo = [typeNameSerializable, color, colorEach, border, seriesAggregateFunction, tag]; export const fillModeMapper = { 'Empty': [], 'Solid': [tag], 'Gradient': GradientFillOptionsInfoBase, 'Hatch': hatchFillOptionsInfo }; const textOrientation = { propertyName: 'textOrientation', modelName: '@TextOrientation', displayName: 'Text Orientation', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Horizontal ', displayValue: 'Horizontal', localizationId: 'DevExpress.XtraCharts.TextOrientation.Horizontal' }, { value: 'TopToBottom', displayValue: 'Top To Bottom', localizationId: 'DevExpress.XtraCharts.TextOrientation.TopToBottom' }, { value: 'BottomToTop', displayValue: 'Bottom To Top', localizationId: 'DevExpress.XtraCharts.TextOrientation.BottomToTop' }], localizationId: 'DevExpress.XtraCharts.SeriesLabelBase.TextOrientation' }, resolveOverlappingMode = { propertyName: 'resolveOverlappingMode', modelName: '@ResolveOverlappingMode', displayName: 'Resolve Overlapping Mode', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'None', displayValue: 'None', localizationId: 'DevExpress.XtraReports.UI.MultiColumnMode.None' }, { value: 'Default', displayValue: 'Default', localizationId: 'DevExpress.XtraReports.UI.WinControlPrintMode.Default' }, { value: 'HideOverlapped', displayValue: 'Hide Overlapped', localizationId: 'DevExpress.XtraCharts.AxisLabelResolveOverlappingMode.HideOverlapped' }, { value: 'JustifyAroundPoint', displayValue: 'Justify Around Point', localizationId: 'DevExpress.XtraCharts.ResolveOverlappingMode.JustifyAroundPoint' }, { value: 'JustifyAllAroundPoint', displayValue: 'Justify All Around Point', localizationId: 'DevExpress.XtraCharts.ResolveOverlappingMode.JustifyAllAroundPoint' }], localizationId: 'DevExpress.XtraCharts.StackedBarTotalLabel.ResolveOverlappingMode' }, lineColor = { propertyName: 'lineColor', modelName: '@LineColor', displayName: 'Line Color', from: colorFromString, toJsonObject: colorToString, editor: editorTemplates.getEditor('customColorEditor'), localizationId: 'DevExpress.XtraCharts.SeriesLabelBase.LineColor' }, lineVisibility = { propertyName: 'lineVisibility', modelName: '@LineVisibility', displayName: 'Line Visibility', editor: editorTemplates.getEditor('combobox'), valuesArray: defaultBooleanValues, localizationId: 'DevExpress.XtraCharts.SeriesLabelBase.LineVisibility' }, lineLength = { propertyName: 'lineLength', modelName: '@LineLength', displayName: 'Line Length', editor: editorTemplates.getEditor('numeric'), localizationId: 'DevExpress.XtraCharts.SeriesLabelBase.LineLength' }, showForZeroValues = { propertyName: 'showForZeroValues', modelName: '@ShowForZeroValues', displayName: 'Show for Zero Values', editor: editorTemplates.getEditor('bool'), from: parseBool, localizationId: 'DevExpress.XtraCharts.BarSeriesLabel.ShowForZeroValues' }; const dashStyle = { propertyName: 'dashStyle', modelName: '@DashStyle', displayName: 'Dash Style', editor: editorTemplates.getEditor('combobox'), valuesArray: [{ value: 'Empty', displayValue: 'Empty', localizationId: 'DevExpress.XtraPivotGrid.PivotGridAppearances.Empty' }, { value: 'Solid', displayValue: 'Solid', localizationId: 'DevExpress.XtraCharts.FillMode3D.Solid' }, { value: 'Dash', displayValue: 'Dash', localizationId: 'DevExpress.XtraCharts.DashStyle.Dash' }, { value: 'Dot', displayValue: 'Dot', localizationId: 'DevExpress.XtraCharts.DashStyle.Dot' }, { value: 'DashDot', displayValue: 'Dash-Dot', localizationId: 'DevExpress.XtraPrinting.BorderDashStyle.DashDot' }, { value: 'DashDotDot', displayValue: 'Dash-Dot-Dot', localizationId: 'DevExpress.XtraPrinting.BorderDashStyle.DashDotDot' }], localizationId: 'DevExpress.XtraCharts.LineStyle.DashStyle' }; const lineStyleSerializationsInfo = [thickness, dashStyle], lineStyle = { propertyName: 'lineStyle', modelName: 'LineStyle', displayName: 'Line Style', info: lineStyleSerializationsInfo, defaultVal: {}, editor: editorTemplates.getEditor('objecteditor'), localizationId: 'DevExpress.XtraReports.UI.XRShape.LineStyle' }; const position = { propertyName: 'seriesLabelPosition', modelName: '@Position', displayName: 'Position', editor: chartEditorTemplates.getEditor('comboboxPositionSeriesLabel'), valuesArray: [], localizationId: 'DevExpress.XtraCharts.PointSeriesLabel.Position' }; const seriesLabelTextPattern = extend(true, {}, textPattern, { localizable: true }); export const seriesLabelSerializationsInfo = [typeNameNotShow, seriesLabelTextPattern, textAlignment, maxLineCount, maxWidth, textOrientation, resolveOverlappingMode, lineColor, lineVisibility, lineLength, antialiasing, backColor, textColor, position, showForZeroValues, font8, lineStyle, border];