MCPcopy
hub / github.com/nhn/tui.chart / renderZeroModel

Method renderZeroModel

apps/chart/src/component/zeroAxis.ts:27–54  ·  view source on GitHub ↗
(zeroPosition: number, vertical: boolean)

Source from the content-addressed store, hash-verified

25 }
26
27 renderZeroModel(zeroPosition: number, vertical: boolean): LineModel[] {
28 const zeroPixel = crispPixel(0);
29 const position = crispPixel(zeroPosition);
30
31 let model: LineModel;
32
33 if (vertical) {
34 model = {
35 type: 'line',
36 x: position,
37 y: zeroPixel,
38 x2: position,
39 y2: crispPixel(this.rect.height),
40 strokeStyle: 'rgba(0, 0, 0, 0.5)',
41 };
42 } else {
43 model = {
44 type: 'line',
45 x: zeroPixel,
46 y: position,
47 x2: crispPixel(this.rect.width),
48 y2: position,
49 strokeStyle: 'rgba(0, 0, 0, 0.5)',
50 };
51 }
52
53 return [model];
54 }
55}

Callers 1

renderMethod · 0.95

Calls 1

crispPixelFunction · 0.90

Tested by

no test coverage detected