-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #623 from natashadecoste/guage
* created gauge chart - squashed * added to react * added to all packages * resized gauge, corrected colors * fixed tooltip * two stories for gauge: circular and semicircular * hidden legend * changed perc symbol size and position, also gauge size * distance between numbers * last fix for text size * carets with svgs * fixed pixel and dominant baseline for firefox * centers caret for firefox * fixed caret size and position * adapts number size with changing of the size of the chart itself * better handling of higher arcRatios * Remove arcRatio, add gauge "type" * Fix sizing and centering of gauge chart * Fix option typings for Gauge chart * Reorganize all sizing and positioning calculations, Simplify data format * Make Gauge colors customizable from options * Gauge: Optical centering of the center number for the presence of the % small symbol * Gauge: Add configuration option for arrow color * Gauge type is now defaulted in configuration.ts * Fixed data format, removed tooltip service * Gauge: Clamp the arc at 100% * Revert "Update CHANGELOG.md" This reverts commit cce62aa. * remove changelog diff * update guage * formatting * review changes * add status, arrow direction, theme & remove spacer * fix guage to work without delta * add enter/merge/exit for value and delta * Update packages/core/src/components/graphs/gauge.ts Co-authored-by: Eliad Moosavi <[email protected]> * Update packages/core/src/configuration.ts Co-authored-by: Donisius Wigie <[email protected]> * review changes * Update packages/core/src/components/graphs/gauge.ts Co-authored-by: Donisius Wigie <[email protected]> * review comments + prettier * review changes * update config names * feat(gauge chart): add gauge chart to carbon-charts re #554 * review changes Co-authored-by: Luca Mattiazzi <[email protected]> Co-authored-by: cesare.soldini <[email protected]> Co-authored-by: Eliad Moosavi <[email protected]> Co-authored-by: Donisius Wigie <[email protected]>
- Loading branch information
1 parent
4ecd191
commit dab1d01
Showing
23 changed files
with
954 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
Component, | ||
AfterViewInit | ||
} from "@angular/core"; | ||
|
||
import { BaseChart } from "./base-chart.component"; | ||
|
||
import { GaugeChart } from "@carbon/charts"; | ||
|
||
/** | ||
* Wrapper around `GaugeChart` in carbon charts library | ||
* | ||
* Most functions just call their equivalent from the chart library. | ||
*/ | ||
@Component({ | ||
selector: "ibm-gauge-chart", | ||
template: `` | ||
}) | ||
export class GaugeChartComponent extends BaseChart implements AfterViewInit { | ||
/** | ||
* Runs after view init to create a chart, attach it to `elementRef` and draw it. | ||
*/ | ||
ngAfterViewInit() { | ||
this.chart = new GaugeChart( | ||
this.elementRef.nativeElement, | ||
{ | ||
data: this.data, | ||
options: this.options | ||
} | ||
); | ||
|
||
Object.assign(this, this.chart); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export const gaugeData = [ | ||
{ group: "value", value: 42 }, | ||
{ group: "delta", value: -13.37 } | ||
]; | ||
|
||
export const gaugeDataNoDelta = [{ group: "value", value: 67 }]; | ||
|
||
// guage no custom color | ||
export const gaugeOptionsSemi = { | ||
title: "Gauge semicircular -- danger status", | ||
resizable: true, | ||
height: "250px", | ||
width: "100%", | ||
gauge: { | ||
type: "semi", | ||
status: "danger" | ||
} | ||
}; | ||
|
||
// guage with custom color | ||
export const gaugeOptionsCircular = { | ||
title: "Gauge circular -- warning status", | ||
resizable: true, | ||
height: "250px", | ||
gauge: { | ||
status: "warning", | ||
type: "full" | ||
} | ||
}; | ||
|
||
// guage with custom color | ||
export const gaugeOptionsCircularNoDelta = { | ||
title: "Gauge circular without delta", | ||
resizable: true, | ||
height: "250px", | ||
gauge: { | ||
type: "full" | ||
}, | ||
color: { | ||
scale: { | ||
value: "#891EE8" | ||
} | ||
} | ||
}; |
Oops, something went wrong.