| Name | Type | Default |
|
renderEngine
# |
enum:DrawRenderEngine
|
''
|
enum DrawRenderEngine { SVG, VML, HTML5 } Sets or gets the renderEngine property.
import { Component } from '@angular/core';
import { jqxDrawModule } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500" [renderEngine]="'HTML5'"> </jqxDraw> `
})
export class App {}
|
|
theme
# |
string
|
''
|
import { Component, viewChild } from '@angular/core';
import { jqxDrawComponent, jqxDrawModule } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: `<jqxDraw #myDraw style="width: 850; height: 500" [theme]="'material'"> </jqxDraw>`,
styles: [``]
})
export class App {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
public ngAfterViewInit(): void {
const size = this.myDraw().getSize();
const borderElement = this.myDraw().rect(0, 0, size.width - 680, size.height, {
stroke: '#777777',
fill: 'transparent'
});
const textElement = this.myDraw().text(
'Drawing shapes',
35,
20,
undefined,
undefined,
0,
{ class: 'largeText', fill: 'yellow', stroke: 'orange' },
false,
'center',
'center',
'centermiddle'
);
const circleElement = this.myDraw().circle(85, 150, 50, {});
this.myDraw().attr(circleElement, { fill: 'lightblue', stroke: 'darkblue' });
const circleUp = this.myDraw().circle(50, 450, 30, { fill: '#DEDEDE', stroke: '#777777' });
const pathUp = this.myDraw().path('M30 460 L 70 460 L50 430 Z', {
fill: 'transparent',
stroke: '#777777',
'stroke-width': 1
});
const circleDown = this.myDraw().circle(120, 450, 30, {
fill: '#DEDEDE',
stroke: '#777777'
});
const pathDown = this.myDraw().path('M100 440 L 140 440 L120 470 Z', {
fill: 'transparent',
stroke: '#777777',
'stroke-width': 1
});
this.myDraw().text('Click these buttons:', 20, 390);
const moveCircle = (moveUp: any) => {
const circleY = parseInt(this.myDraw().getAttr(circleElement, 'cy'));
this.myDraw().attr(circleElement, { cy: circleY + (moveUp ? -10 : 10) });
};
this.myDraw().on(circleUp, 'click', () => {
moveCircle(true);
});
this.myDraw().on(pathUp, 'click', () => {
moveCircle(true);
});
this.myDraw().on(circleDown, 'click', () => {
moveCircle(false);
});
this.myDraw().on(pathDown, 'click', () => {
moveCircle(false);
});
}
}
|
|
|
|
|
| Name | Return Type | Arguments |
|
attr
# |
Void
|
element: Any, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
const element = this.myDraw().circle(250, 150, 50, { fill: 'lightgreen' });
this.myDraw().attr(element, { fill: 'lightblue', stroke: 'darkblue' });
}
}
|
|
circle
# |
Any
|
cx: Number, cy: Number, r: Number, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().circle(250, 150, 50, {});
}
}
|
|
clear
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
this.myDraw().clear();
}
}
|
|
getAttr
# |
String
|
element: Any, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
const element = this.myDraw().circle(250, 150, 50, { fill: 'lightgreen' });
let value = this.myDraw().getAttr(element, 'fill');
}
}
|
|
getSize
# |
Any
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().getSize();
}
}
|
|
line
# |
Any
|
x1: Number, y1: Number, x2: Number, y2: Number, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().line(600, 100, 600, 200, { stroke: 'blue', 'stroke-width': 6 });
}
}
|
|
measureText
# |
Any
|
text: String, angle: Number, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().measureText('My text', 45, { class: 'smallText' });
}
}
|
|
on
# |
Void
|
element: Any, event: String, func: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
const element = this.myDraw().circle(250, 150, 50, { fill: 'lightgreen' });
this.myDraw().on(element, 'click', () => {});
}
}
|
|
off
# |
Void
|
element: Any, event: String, func: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
const element = this.myDraw().circle(250, 150, 50, { fill: 'lightgreen' });
this.myDraw().off(element, 'click', () => {});
}
}
|
|
path
# |
Any
|
path: String, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw>`
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().path('M 100,100 L 150,130 C 130,130 180,190 150,150', {
stroke: '#777777',
fill: 'red'
});
}
}
|
|
pieslice
# |
Any
|
cx: Number, xy: Number, innerRadius: Any, outerRadius: Any, fromAngle: Number, endAngle: Number, centerOffset: Number, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().pieslice(250, 150, 50, 100, 15, 95, 0, { fill: 'yellow' });
}
}
|
|
refresh
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
this.myDraw().refresh();
}
}
|
|
rect
# |
Any
|
x: Number, y: Number, width: Size, height: Size, attributes: Any
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().rect(0, 0, 200, 100, { stroke: '#777777', fill: 'transparent' });
}
}
|
|
saveAsJPEG
# |
Void
|
image: String, url: String
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
this.myDraw().saveAsJPEG('myImage.jpeg', 'http://<my domain>/export_server/server.php');
}
}
|
|
saveAsPNG
# |
Void
|
image: String, url: String
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
this.myDraw().saveAsPNG('myImage.png', 'http://<my domain>/export_server/server.php');
}
}
|
|
text
# |
Any
|
text: String, x: Number, y: Number, width: Size, height: Size, angle: Number, attributes: Any, clip: Boolean, halign: String, valign: String, rotateAround: String
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxDrawModule, jqxDrawComponent } from 'jqwidgets-ng/jqxdraw';
@Component({
selector: 'app-root',
imports: [jqxDrawModule],
template: ` <jqxDraw #myDraw [width]="850" [height]="500"> </jqxDraw> `
})
export class App implements AfterViewInit {
readonly myDraw = viewChild.required<jqxDrawComponent>('myDraw');
ngAfterViewInit(): void {
let value = this.myDraw().text(
'Drawing Shapes',
50,
20,
undefined,
undefined,
0,
{ class: 'largeText', fill: 'yellow', stroke: 'orange' },
false,
'center',
'center',
'centermiddle'
);
}
}
|