| /* |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Initial contribution: |
| * Loetz GmbH & Co. KG |
| * |
| */ |
| grammar org.eclipse.osbp.xtext.chart.ChartDSL with org.eclipse.osbp.xtext.oxtype.OXtype |
| |
| import "http://osbp.eclipse.org/xtext/chart/ChartDSL" |
| |
| import "http://osbp.eclipse.org/xtext/datamartdsl/DatamartDSL" as datamart |
| import "http://osbp.eclipse.org/xtext/cubedsl/CubeDSL" as cube |
| import "http://osbp.eclipse.org/dsl/common/types/v1" as types |
| import "http://osbp.eclipse.org/dsl/entity/v1" as entity |
| import "http://www.eclipse.org/emf/2002/Ecore" as ecore |
| |
| ChartModel: |
| importSection=XImportSection? |
| packages+=ChartPackage*; |
| |
| ChartPackage: |
| {ChartPackage} 'package' name=QualifiedName ('{' (charts+=Chart)* '}' )?; |
| |
| Chart: |
| {Chart} 'chart' name=TRANSLATABLEID (description?='describedBy' descriptionValue=TRANSLATABLESTRING)? 'as' charttype=ChartOption ((polling?='polling' pollingTime=INT)? & (selectById?='selectById')?) ('using' source=ChartDatamart)?; |
| |
| ChartOption: |
| ChartBar | ChartLine | ChartPie | ChartDonut | ChartBubble | ChartGauge | ChartTree; |
| |
| ChartBar: |
| {ChartBar} 'bar' ((shadow?='shaded')? & (animated?='animated')? & (swapped?='swapped')? & (stacked?='stacked')?); |
| |
| ChartLine: |
| {ChartLine} 'line' ((animated?='animated')? & (showMarker?='showMarker')? & (trendLine?='trendLine')? & (cursor?='cursor' (zoom?='zoom')? (tooltip?='tooltip')?)? & (fillToZero?='fillZero')? & (fillArea?='filled')?); |
| |
| ChartPie: |
| {ChartPie} 'pie' (empty?='empty')?; |
| |
| ChartDonut: |
| {ChartDonut} 'donut'; |
| |
| ChartBubble: |
| {ChartBubble} 'bubble' ((multiplier?='multiplier' multiplierValue=Number)? & ((gradient?='gradient') | (transparent?='transparent')))?; |
| |
| ChartGauge: |
| {ChartGauge} 'gauge' ((labeled?='label' labelValue=STRING)? & (hasTicks?='hasTicks' 'minimum' minValue=INT 'maximum' maxValue=INT)? & (hasIntervals?='intervals' '{' (intervals+=ChartInterval)* '}')?); |
| |
| ChartTree: |
| {ChartTree} 'tree' ((map?='map') | (collapsible?='collapsible')); |
| |
| ChartInterval: |
| ChartNumberInterval; |
| |
| ChartNumberInterval: |
| {ChartNumberInterval} 'upTo' numberIntervalValue=SignedNumber numberRange=ChartRangeElement; |
| |
| ChartDatamart: |
| 'datamart' datamartRef=[datamart::DatamartDefinition] '{' elements+=ChartElement* '}'; |
| |
| ChartElement: |
| ChartAxis | ChartLegend | ChartHighlighter; |
| |
| ChartLegend: |
| 'legend' placement=LegendPlacementEnum (toggle?='toggle' replot?='replot' toggleType=ToggleTypeEnum)?; |
| |
| ChartHighlighter: |
| 'tooltip' location=TooltipLocationEnum ((tooltipAlways?='always')? (insideChart?='inside')?); |
| |
| ChartAxis: |
| 'axis' axis=[datamart::DatamartAxis] 'renders' renderType=RenderTypeEnum (shortLabel?='shortLabel')? ('angle' angle=SignedNumber)?; |
| |
| ChartRangeElement: |
| ChartSegmentColor; |
| |
| ChartSegmentColor: |
| 'segmentcolor' rgb=STRING; |
| |
| SignedNumber returns ecore::EInt: |
| ('-'? INT)?; |
| |
| TRANSLATABLESTRING: STRING; |
| |
| TRANSLATABLEID: |
| ID; |
| |
| enum LegendPlacementEnum: |
| INSIDE='inside' | INSIDE_GRID='inside-grid' | OUTSIDE='outside' | OUTSIDE_GRID='outside-grid'; |
| |
| enum ToggleTypeEnum: |
| NORMAL='normal' | SLOW='slow' | FAST='fast'; |
| |
| enum TooltipLocationEnum: |
| NORTH='north' | NORTH_EAST='north-east' | EAST='east' | SOUTH_EAST='south-east' | SOUTH='south' | SOUTH_WEST='south-west' | WEST='west' | NORTH_WEST='north-west'; |
| |
| enum RenderTypeEnum: |
| CATEGORY='category' | LINEAR='linear' | DATE='date' | LOG='logarithmic' |PYRAMID='pyramid'; |
| |