Skip to content

Commit a88f8e9

Browse files
committed
added a range chart
1 parent dcba91a commit a88f8e9

File tree

14 files changed

+734
-51
lines changed

14 files changed

+734
-51
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.settings
44
typings/
55
node_modules/
6-
**/node_modules/
6+
**/node_modules/
7+
**/.idea

charts/complexCharts/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/node_modules
99

1010
# IDEs and editors
11-
/.idea
11+
*/.idea/
1212
.project
1313
.classpath
1414
.c9/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<h1>
2-
Consumption charts
2+
Consumption charts!!
33
</h1>
44
<consumption></consumption>

charts/complexCharts/src/app/app.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import {FormsModule} from "@angular/forms";
66
import {AppComponent} from "./app.component";
77
import {ConsumptionComponent} from "./consumption/consumption.component";
88
import {ConsumptionDataService} from "./services/consumption-data-service";
9+
import {LineRangeChartModule} from "./line-range-chart/line-range-chart.module";
910

1011
@NgModule({
1112
declarations: [
1213
AppComponent,
13-
ConsumptionComponent
14+
ConsumptionComponent,
1415
],
1516
imports: [
1617
BrowserModule,
1718
FormsModule,
1819
HttpModule,
19-
NgxChartsModule
20+
NgxChartsModule,
21+
LineRangeChartModule
2022
],
2123
exports: [],
2224
providers: [ConsumptionDataService],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export class SeriesEntry {
2-
constructor(public name: string | Date | number, public value: number) {}
2+
constructor(public name: string | Date | number, public value: number, public min ?:number, public max ?: number) {}
33
}
44

charts/complexCharts/src/app/consumption/consumption.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</tr>
3030
<tr>
3131
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
32-
(click)="onClickAverageConsumptionBySpeed(10, 'both', false)"> average consumption by speed
32+
(click)="onClickAverageConsumptionBySpeed(10, 'both', true)"> average consumption by speed
3333
(coarse-grained)
3434
</td>
3535
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
@@ -43,7 +43,7 @@
4343
</tr>
4444
<tr>
4545
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
46-
(click)="onClickAverageConsumptionBySpeed(5, 'both', false)"> average consumption by speed (medium)
46+
(click)="onClickAverageConsumptionBySpeed(5, 'both', true)"> average consumption by speed (medium)
4747
</td>
4848
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
4949
(click)="onClickAverageConsumptionBySpeed(5, 'civic', true)"> average consumption by speed (medium)
@@ -54,7 +54,7 @@
5454
</tr>
5555
<tr>
5656
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
57-
(click)="onClickAverageConsumptionBySpeed(2, 'both', false)"> average consumption by speed
57+
(click)="onClickAverageConsumptionBySpeed(2, 'both', true)"> average consumption by speed
5858
(fine-grained)
5959
</td>
6060
<td><input type="radio" name="chartType" value="averageConsumptionBySpeed"
@@ -70,7 +70,7 @@
7070
</form>
7171

7272

73-
<ngx-charts-line-chart
73+
<ngx-charts-line-range-chart
7474
*ngIf="visible"
7575
[view]="view"
7676
class="chart-container"
@@ -88,8 +88,8 @@
8888
[yAxisLabel]="yAxisLabel"
8989
autoScale="true"
9090
timeline="true"
91-
showGridLines="true"
91+
showGridLines="false "
9292
[curve]="curve"
9393
(select)="select($event)">
94-
</ngx-charts-line-chart>
94+
</ngx-charts-line-range-chart>
9595

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './line-range-chart.module';
2+
export * from './line-range-chart.component';
3+
export * from './line-range.component';
4+
export * from './line-range-series.component';

0 commit comments

Comments
 (0)