武田 憲太郎
2017-07-16 18:44:47 +09:00
parent e930438f4b
commit e144f0643c
2 changed files with 19 additions and 0 deletions
+9
View File
@@ -26,3 +26,12 @@ let chart: Chart = new Chart(new CanvasRenderingContext2D(), {
}
});
chart.update();
console.log(chart.ctx && chart.ctx.font);
console.log(chart.canvas && chart.canvas.tagName);
if (chart.chartArea) {
console.log(chart.chartArea.top);
console.log(chart.chartArea.right);
console.log(chart.chartArea.bottom);
console.log(chart.chartArea.left);
}
+10
View File
@@ -26,6 +26,9 @@ declare class Chart {
getElementAtEvent: (e: any) => {};
getElementsAtEvent: (e: any) => Array<{}>;
getDatasetAtEvent: (e: any) => Array<{}>;
ctx: CanvasRenderingContext2D|null;
canvas: HTMLCanvasElement|null;
chartArea: Chart.ChartArea;
static pluginService: PluginServiceStatic;
static defaults: {
@@ -80,6 +83,13 @@ declare namespace Chart {
type PositionType = 'left' | 'right' | 'top' | 'bottom';
interface ChartArea {
top: number;
right: number;
bottom: number;
left: number;
}
interface ChartLegendItem {
text?: string;
fillStyle?: string;