Skip to content

Commit bedfed5

Browse files
authored
Merge pull request #732 from IgniteUI/sstoychev/eq-vnext-with-master
Sstoychev/eq vnext with master
2 parents 80c6635 + 8056744 commit bedfed5

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

samples/charts/data-chart/scatter-bubble-chart-fill-scale/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@
1717
<div id="root">
1818

1919
<div class="container sample">
20+
<div class="options vertical">
21+
<igc-property-editor-panel
22+
name="PropertyEditor"
23+
id="PropertyEditor"
24+
description-type="DataChart"
25+
is-horizontal="true"
26+
is-wrapping-enabled="true">
27+
<igc-property-editor-property-description
28+
name="FillScaleMinimumValueEditor"
29+
id="FillScaleMinimumValueEditor"
30+
label="MinimumValue: "
31+
value-type="Slider"
32+
min="0"
33+
max="20000">
34+
</igc-property-editor-property-description>
35+
<igc-property-editor-property-description
36+
name="FillScaleMaximumValueEditor"
37+
id="FillScaleMaximumValueEditor"
38+
label="MaximumValue: "
39+
value-type="Slider"
40+
min="25000"
41+
max="100000">
42+
</igc-property-editor-property-description>
43+
</igc-property-editor-panel>
44+
</div>
2045

2146
<div class="container fill">
2247
<igc-data-chart

samples/charts/data-chart/scatter-bubble-chart-fill-scale/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
"@webcomponents/template": "^1.4.2",
2727
"babel-runtime": "^6.26.0",
2828
"core-js": "^3.6.5",
29+
"igniteui-webcomponents": "4.8.0",
2930
"igniteui-webcomponents-charts": "4.8.0",
3031
"igniteui-webcomponents-core": "4.8.0",
32+
"igniteui-webcomponents-inputs": "4.8.0",
33+
"igniteui-webcomponents-layouts": "4.8.0",
3134
"lit-html": "^2.2.0",
3235
"tslib": "^2.0.0"
3336
},

samples/charts/data-chart/scatter-bubble-chart-fill-scale/src/index.ts

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { IgcNumberAbbreviatorModule, IgcDataChartCoreModule, IgcDataChartScatterModule, IgcDataChartScatterCoreModule, IgcDataChartInteractivityModule, IgcDataChartAnnotationModule } from 'igniteui-webcomponents-charts';
2-
import { ComponentRenderer, NumberAbbreviatorDescriptionModule, DataChartCoreDescriptionModule, DataChartScatterDescriptionModule, DataChartScatterCoreDescriptionModule, DataChartInteractivityDescriptionModule, DataChartAnnotationDescriptionModule } from 'igniteui-webcomponents-core';
2+
import { IgcPropertyEditorPanelModule } from 'igniteui-webcomponents-layouts';
3+
import { ComponentRenderer, NumberAbbreviatorDescriptionModule, DataChartCoreDescriptionModule, DataChartScatterDescriptionModule, DataChartScatterCoreDescriptionModule, DataChartInteractivityDescriptionModule, DataChartAnnotationDescriptionModule, PropertyEditorPanelDescriptionModule } from 'igniteui-webcomponents-core';
4+
import { IgcPropertyEditorPanelComponent, IgcPropertyEditorPropertyDescriptionComponent } from 'igniteui-webcomponents-layouts';
35
import { IgcDataChartComponent, IgcNumericXAxisComponent, IgcNumericYAxisComponent, IgcBubbleSeriesComponent, IgcSizeScaleComponent, IgcValueBrushScaleComponent } from 'igniteui-webcomponents-charts';
46
import { WorldDebtAndPopulationItem, WorldDebtAndPopulation } from './WorldDebtAndPopulation';
7+
import { IgcPropertyEditorPropertyDescriptionChangedEventArgs } from 'igniteui-webcomponents-layouts';
8+
import { EnumUtil } from 'igniteui-webcomponents-core';
59

10+
import 'igniteui-webcomponents/themes/light/bootstrap.css';
11+
import { defineAllComponents } from 'igniteui-webcomponents';
612
import { ModuleManager } from 'igniteui-webcomponents-core';
13+
defineAllComponents();
714

815
import "./index.css";
916

@@ -13,11 +20,15 @@ ModuleManager.register(
1320
IgcDataChartScatterModule,
1421
IgcDataChartScatterCoreModule,
1522
IgcDataChartInteractivityModule,
16-
IgcDataChartAnnotationModule
23+
IgcDataChartAnnotationModule,
24+
IgcPropertyEditorPanelModule
1725
);
1826

1927
export class Sample {
2028

29+
private propertyEditor: IgcPropertyEditorPanelComponent
30+
private fillScaleMinimumValueEditor: IgcPropertyEditorPropertyDescriptionComponent
31+
private fillScaleMaximumValueEditor: IgcPropertyEditorPropertyDescriptionComponent
2132
private chart: IgcDataChartComponent
2233
private xAxis: IgcNumericXAxisComponent
2334
private yAxis: IgcNumericYAxisComponent
@@ -52,12 +63,21 @@ export class Sample {
5263
private _bind: () => void;
5364

5465
constructor() {
66+
var propertyEditor = this.propertyEditor = document.getElementById('PropertyEditor') as IgcPropertyEditorPanelComponent;
67+
var fillScaleMinimumValueEditor = this.fillScaleMinimumValueEditor = document.getElementById('FillScaleMinimumValueEditor') as IgcPropertyEditorPropertyDescriptionComponent;
68+
this.scatterBubbleSeriesFillScaleSliderChanged = this.scatterBubbleSeriesFillScaleSliderChanged.bind(this);
69+
var fillScaleMaximumValueEditor = this.fillScaleMaximumValueEditor = document.getElementById('FillScaleMaximumValueEditor') as IgcPropertyEditorPropertyDescriptionComponent;
70+
this.scatterBubbleSeriesFillScaleSliderChanged = this.scatterBubbleSeriesFillScaleSliderChanged.bind(this);
5571
var chart = this.chart = document.getElementById('chart') as IgcDataChartComponent;
5672
var xAxis = this.xAxis = document.getElementById('xAxis') as IgcNumericXAxisComponent;
5773
var yAxis = this.yAxis = document.getElementById('yAxis') as IgcNumericYAxisComponent;
5874
var bubbleSeries1 = this.bubbleSeries1 = document.getElementById('BubbleSeries1') as IgcBubbleSeriesComponent;
5975

6076
this._bind = () => {
77+
propertyEditor.componentRenderer = this.renderer;
78+
propertyEditor.target = this.chart;
79+
fillScaleMinimumValueEditor.changed = this.scatterBubbleSeriesFillScaleSliderChanged;
80+
fillScaleMaximumValueEditor.changed = this.scatterBubbleSeriesFillScaleSliderChanged;
6181
bubbleSeries1.radiusScale = this.sizeScale1;
6282
bubbleSeries1.xAxis = this.xAxis;
6383
bubbleSeries1.yAxis = this.yAxis;
@@ -88,10 +108,24 @@ export class Sample {
88108
DataChartScatterCoreDescriptionModule.register(context);
89109
DataChartInteractivityDescriptionModule.register(context);
90110
DataChartAnnotationDescriptionModule.register(context);
111+
PropertyEditorPanelDescriptionModule.register(context);
91112
}
92113
return this._componentRenderer;
93114
}
94115

116+
public scatterBubbleSeriesFillScaleSliderChanged(sender: any, args: IgcPropertyEditorPropertyDescriptionChangedEventArgs): void {
117+
let series: IgcBubbleSeriesComponent = this.chart.actualSeries[0] as IgcBubbleSeriesComponent;
118+
119+
let fillScale = (series.fillScale as any);
120+
121+
if(args.newValue >= 25000){
122+
fillScale.maximumValue = args.newValue;
123+
}
124+
else{
125+
fillScale.minimumValue = args.newValue;
126+
}
127+
}
128+
95129
}
96130

97131
new Sample();

0 commit comments

Comments
 (0)