Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
404 Client Error. (Request ID: Root=1-69df1622-5cf2e52832e4475c4883413c;b00caaa3-803b-4b7b-b0e1-8efd8336991c) Revision Not Found for url: https://huggingface.co/api/datasets/hreyulog/arkts-code-docstring-resplit-by-repo/revision/refs%2Fconvert%2Fparquet. Invalid rev id: refs/convert/parquet
Error code:   UnexpectedError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

nwo
string
sha
string
path
string
language
string
identifier
string
docstring
string
function
string
ast_function
string
obf_function
string
url
string
function_sha
string
source
string
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setAxisMaxLabels
The maximum number of labels on the axis
public setAxisMaxLabels(labels: number): void { if (labels > 0) this.mAxisMaxLabels = labels; }
AST#method_declaration#Left public setAxisMaxLabels AST#parameter_list#Left ( AST#parameter#Left labels : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
public setAxisMaxLabels(labels: number): void { if (labels > 0) this.mAxisMaxLabels = labels; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L172-L175
8f580a33a220f9a3363cf76cb8226cc8792acd5c
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/Transformer.ets
arkts
pointValuesToPixel
Transform an array of points with all matrices. VERY IMPORTANT: Keep matrix order "value-touch-offset" when transforming. @param pts
public pointValuesToPixel(pts: number[]) { this.mMatrixValueToPx.mapPoints(pts); this.mViewPortHandler.getMatrixTouch().mapPoints(pts); this.mMatrixOffset.mapPoints(pts); }
AST#method_declaration#Left public pointValuesToPixel AST#parameter_list#Left ( AST#parameter#Left pts : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function...
public pointValuesToPixel(pts: number[]) { this.mMatrixValueToPx.mapPoints(pts); this.mViewPortHandler.getMatrixTouch().mapPoints(pts); this.mMatrixOffset.mapPoints(pts); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L278-L282
ca49bdb57d6f6d99351e52f3c6c7357eda698e4d
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets
arkts
setHighlightLineWidth
Sets the width of the highlight line in vp. @param width
public setHighlightLineWidth(width: number): void { this.mHighlightLineWidth = Utils.handleDataValues(width); }
AST#method_declaration#Left public setHighlightLineWidth AST#parameter_list#Left ( AST#parameter#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#pr...
public setHighlightLineWidth(width: number): void { this.mHighlightLineWidth = Utils.handleDataValues(width); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets#L73-L75
3ca7a8a6e363568a6d5a7d217940afbb6227964d
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/scrollingCharts/viewPageItems/frag_simple_scatter_index.ets
arkts
generateScatterData
初始化数据 @param count 曲线图点的个数 @param range y轴范围
private generateScatterData(dataSets: number, range: number, count: number): ScatterData { let sets: JArrayList<IScatterDataSet> = new JArrayList<IScatterDataSet>(); let shapes = [ChartShape.SQUARE, ChartShape.CIRCLE, ChartShape.TRIANGLE, ChartShape.CROSS, ChartShape.X, ChartShape.CHEVRON_UP, ChartShape.CHEVRON...
AST#method_declaration#Left private generateScatterData AST#parameter_list#Left ( AST#parameter#Left dataSets : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left range : AST#type_annotation#Left AST#primary_type#Left number AS...
private generateScatterData(dataSets: number, range: number, count: number): ScatterData { let sets: JArrayList<IScatterDataSet> = new JArrayList<IScatterDataSet>(); let shapes = [ChartShape.SQUARE, ChartShape.CIRCLE, ChartShape.TRIANGLE, ChartShape.CROSS, ChartShape.X, ChartShape.CHEVRON_UP, ChartShape.CHEVRON...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/scrollingCharts/viewPageItems/frag_simple_scatter_index.ets#L99-L119
91fe95cac4b1e46621e87f9ea75f70c65fa838b2
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getCenterTextOffset
Returns the offset on the x- and y-axis the center text has in vp. @return
public getCenterTextOffset(): MPPointF { return MPPointF.getInstance(this.mCenterTextOffset.x, this.mCenterTextOffset.y); }
AST#method_declaration#Left public getCenterTextOffset AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left MPPointF AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#ca...
public getCenterTextOffset(): MPPointF { return MPPointF.getInstance(this.mCenterTextOffset.x, this.mCenterTextOffset.y); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L603-L605
88ad1517fd58f8ff0832b48e9f91223c02f6fea4
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/Transformer.ets
arkts
rectValueToPixelHorizontal
Transform a rectangle with all matrices with potential animation phases. @param r
public rectValueToPixelHorizontal(r: MyRect, phaseY?: number) { if (phaseY != null && phaseY != undefined) { r.left *= phaseY; r.right *= phaseY; } this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
AST#method_declaration#Left public rectValueToPixelHorizontal AST#parameter_list#Left ( AST#parameter#Left r : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left phaseY ? : AST#type_annotation#Left AST#primary_type#Left number ...
public rectValueToPixelHorizontal(r: MyRect, phaseY?: number) { if (phaseY != null && phaseY != undefined) { r.left *= phaseY; r.right *= phaseY; } this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L329-L337
b3a8c1155aff385b08139709636d893e4f766483
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setTransparentCircleAlpha
Sets the amount of transparency the transparent circle should have 0 = fully transparent, 255 = fully opaque. Default value is 100. @param alpha 0-255
public setTransparentCircleAlpha(alpha: number): void { if (!this.mRenderer) { return; } ( /*(PieChartRenderer)*/ this.mRenderer as PieChartRenderer).getPaintTransparentCircle().setGlobalAlpha(alpha / 255); }
AST#method_declaration#Left public setTransparentCircleAlpha AST#parameter_list#Left ( AST#parameter#Left alpha : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AS...
public setTransparentCircleAlpha(alpha: number): void { if (!this.mRenderer) { return; } ( this.mRenderer as PieChartRenderer).getPaintTransparentCircle().setGlobalAlpha(alpha / 255); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L677-L683
eec9588eae10d90de0e0cc0e6d6425c5c640c9e7
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/XAxisLabelPosition.ets
arkts
标签绘制位置的枚举
export enum XAxisLabelPosition { Left, Center, Right }
AST#export_declaration#Left export AST#enum_declaration#Left enum XAxisLabelPosition AST#enum_body#Left { AST#enum_member#Left Left AST#enum_member#Right , AST#enum_member#Left Center AST#enum_member#Right , AST#enum_member#Left Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_dec...
export enum XAxisLabelPosition { Left, Center, Right }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/XAxisLabelPosition.ets#L19-L23
8cec93fdb33e14b746676c0b8f2d960ca0e51a68
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/FSize.ets
arkts
Class for describing width and height dimensions in some arbitrary
export default class FSize extends Poolable { public width: number = 0; public height: number = 0; public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0)) .setReplenishPercentage(0.5) as ObjectPool<FSize>; instantiate(): Poolable { return new FSize(0, 0); } public static ge...
AST#export_declaration#Left export AST#ERROR#Left default class FSize extends AST#type_annotation#Left AST#primary_type#Left Poolable AST#primary_type#Right AST#type_annotation#Right { AST#property_declaration#Left public width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_anno...
export default class FSize extends Poolable { public width: number = 0; public height: number = 0; public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0)) .setReplenishPercentage(0.5) as ObjectPool<FSize>; instantiate(): Poolable { return new FSize(0, 0); } public static ge...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/FSize.ets#L24-L51
0185ce7d6c57d8d778a084b9b1e5f1f3e5edda38
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/DataRenderer.ets
arkts
drawValue
Draws the value of the given entry by using the provided IValueFormatter. @param c canvas @param formatter formatter for custom value-formatting @param value the value to be drawn @param entry the entry the value belongs to @param dataSetIndex the index of the DataSet the drawn Entry belong...
public drawValue(c: CanvasRenderingContext2D, formatter: IValueFormatter, value: number, entry: EntryOhos, dataSetIndex: number, x: number, y: number, color: number, isHorizontalFlip: boolean = false): void { if (isHorizontalFlip) { c.save(); c.scale(-1, 1); } this.mValuePaint.setColor(color); ...
AST#method_declaration#Left public drawValue AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left formatter : AST#type_annotation#Left AST#primary_type#Left IValu...
public drawValue(c: CanvasRenderingContext2D, formatter: IValueFormatter, value: number, entry: EntryOhos, dataSetIndex: number, x: number, y: number, color: number, isHorizontalFlip: boolean = false): void { if (isHorizontalFlip) { c.save(); c.scale(-1, 1); } this.mValuePaint.setColor(color); ...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/DataRenderer.ets#L168-L190
79ba20abbe249dfc2663cc91750c1b06392da594
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineDataSet.ets
arkts
setDrawCircles
set this to true to enable the drawing of circle indicators for this DataSet, default true @param enabled
public setDrawCircles(enabled: boolean): void { this.mDrawCircles = enabled; }
AST#method_declaration#Left public setDrawCircles AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
public setDrawCircles(enabled: boolean): void { this.mDrawCircles = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineDataSet.ets#L235-L237
142dd04ce46cc1206296ca10277e55dd86133a45
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ColorTemplate.ets
arkts
red
from Color red() @param color
public static red(color: number): number { return (color >> 16) & 0xFF; }
AST#method_declaration#Left public static red AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_typ...
public static red(color: number): number { return (color >> 16) & 0xFF; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ColorTemplate.ets#L250-L252
a54a5d49abbc811c4d4a2d8150418b05fe84e357
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/Rect.ets
arkts
offsetTo
Offset the rectangle to a specific (left, top) position, keeping its width and height the same. @param newLeft The new "left" coordinate for the rectangle @param newTop The new "top" coordinate for the rectangle
public offsetTo(newLeft: number, newTop: number) { this.right += newLeft - this.left; this.bottom += newTop - this.top; this.left = newLeft; this.top = newTop; }
AST#method_declaration#Left public offsetTo AST#parameter_list#Left ( AST#parameter#Left newLeft : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left newTop : AST#type_annotation#Left AST#primary_type#Left number AST#primary_ty...
public offsetTo(newLeft: number, newTop: number) { this.right += newLeft - this.left; this.bottom += newTop - this.top; this.left = newLeft; this.top = newTop; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L183-L188
480f749d38f365b4483c2f4ad5c34105670d5438
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/BarChartModel.ets
arkts
calcMinMax
@Override
protected calcMinMax(): void { if (!this.mData) { return; } if (this.mXAxis) { if (this.mFitBars) { this.mXAxis.calculate(this.mData.getXMin() - this.mData.getBarWidth() / 2, this.mData.getXMax() + this.mData.getBarWidth() / 2); } else { this.mXAxis.calculate(this.mData.get...
AST#method_declaration#Left protected calcMinMax AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#...
protected calcMinMax(): void { if (!this.mData) { return; } if (this.mXAxis) { if (this.mFitBars) { this.mXAxis.calculate(this.mData.getXMin() - this.mData.getBarWidth() / 2, this.mData.getXMax() + this.mData.getBarWidth() / 2); } else { this.mXAxis.calculate(this.mData.get...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/BarChartModel.ets#L93-L111
05ee9718f164b256f6b8197cfc5b4c71b9fca3f1
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setValueFormatter
Sets the formatter to be used for formatting the axis labels. If no formatter is set, the chart will automatically determine a reasonable formatting (concerning decimals) for all the values that are drawn inside the chart. Use chart.getDefaultValueFormatter() to use the formatter calculated by the chart. @param f
public setValueFormatter(f: IAxisValueFormatter): void { if (!f || f == null) this.mAxisValueFormatter = new DefaultAxisValueFormatter(this.mDecimals); else this.mAxisValueFormatter = f; }
AST#method_declaration#Left public setValueFormatter AST#parameter_list#Left ( AST#parameter#Left f : AST#type_annotation#Left AST#primary_type#Left IAxisValueFormatter AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void A...
public setValueFormatter(f: IAxisValueFormatter): void { if (!f || f == null) this.mAxisValueFormatter = new DefaultAxisValueFormatter(this.mDecimals); else this.mAxisValueFormatter = f; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L553-L559
1b2ee147f29c8d28653c25bc8bfe81da7442507c
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
onDraw
@Override
public onDraw(canvas: CanvasRenderingContext2D): void { super.onDraw(canvas); if (this.mData == null) return; this.mRenderer?.drawData(canvas); if (this.valuesToHighlight() && this.mIndicesToHighlight) { this.mRenderer?.drawHighlighted(canvas, this.mIndicesToHighlight); } this.mRe...
AST#method_declaration#Left public onDraw AST#parameter_list#Left ( AST#parameter#Left canvas : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AS...
public onDraw(canvas: CanvasRenderingContext2D): void { super.onDraw(canvas); if (this.mData == null) return; this.mRenderer?.drawData(canvas); if (this.valuesToHighlight() && this.mIndicesToHighlight) { this.mRenderer?.drawHighlighted(canvas, this.mIndicesToHighlight); } this.mRe...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L134-L154
3930d36f553a3b63f3165544cdfc65e66fa5b486
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/PieDataSet.ets
arkts
isAutomaticallyDisableSliceSpacingEnabled
When enabled, slice spacing will be 0.0 when the smallest value is going to be smaller than the slice spacing itself. @return @Override
public isAutomaticallyDisableSliceSpacingEnabled(): boolean { return this.mAutomaticallyDisableSliceSpacing; }
AST#method_declaration#Left public isAutomaticallyDisableSliceSpacingEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#e...
public isAutomaticallyDisableSliceSpacingEnabled(): boolean { return this.mAutomaticallyDisableSliceSpacing; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieDataSet.ets#L123-L125
25013ac9445b848914c0fd57a72740e93b38de3b
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getRadius
@Override
public getRadius(): number { if (this.mCircleBox == null) return 0; else { return Math.min(this.mCircleBox.width() / 2, this.mCircleBox.height() / 2); } }
AST#method_declaration#Left public getRadius AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Le...
public getRadius(): number { if (this.mCircleBox == null) return 0; else { return Math.min(this.mCircleBox.width() / 2, this.mCircleBox.height() / 2); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L530-L536
7af331d9d7edd844174ada2dcfae237e92f1c54e
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/BarChartRenderer.ets
arkts
private width:number = 0; private height:number = 0; private singleWidth:number = 0; private marginCount:number = 12; private marginRight:number = 0; private count :number = 0;
constructor(chart: BarDataProvider, animator: ChartAnimator, viewPortHandler: ViewPortHandler) { super(animator, viewPortHandler); this.mChart = chart; this.mHighlightPaint = new Paint(); this.mHighlightPaint.setStyle(Style.FILL); this.mHighlightPaint.setColor(Color.Black); // set alpha after c...
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left chart : AST#type_annotation#Left AST#primary_type#Left BarDataProvider AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left animator : AST#type_annotation#Left AST#primary_type#Left ChartAnimat...
constructor(chart: BarDataProvider, animator: ChartAnimator, viewPortHandler: ViewPortHandler) { super(animator, viewPortHandler); this.mChart = chart; this.mHighlightPaint = new Paint(); this.mHighlightPaint.setStyle(Style.FILL); this.mHighlightPaint.setColor(Color.Black); this.mHighlight...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/BarChartRenderer.ets#L57-L72
eb0577a12767792c31c7b119a80c3ef4d437f9b2
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/Rect.ets
arkts
contains
Returns true if (x,y) is inside the rectangle. The left and top are considered to be inside, while the right and bottom are not. This means that for a x,y to be contained: left <= x < right and top <= y < bottom. An empty rectangle never contains any point. @param x The X coordinate of the point being tested for conta...
public contains(x: number, y: number): boolean { return this.left < this.right && this.top < this.bottom // check for empty first && x >= this.left && x < this.right && y >= this.top && y < this.bottom; }
AST#method_declaration#Left public contains AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AS...
public contains(x: number, y: number): boolean { return this.left < this.right && this.top < this.bottom && x >= this.left && x < this.right && y >= this.top && y < this.bottom; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L217-L220
d67a4e46b070849ba486ae8c34e1e0e5609991fd
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/PieData.ets
arkts
A PieData object can only represent one DataSet. Unlike all other charts, the legend labels of the PieChart are created from the x-values array, and not from the DataSet labels. Each PieData object can only represent one PieDataSet (multiple PieDataSets inside a single PieChart are not possible).
export default class PieData extends ChartData<IPieDataSet> { constructor(dataSet?: IPieDataSet) { if (dataSet) { super([dataSet]); } else { super(); } } // public PieData(IPieDataSet dataSet) { // super(dataSet); // } /** * Sets the PieDataSet this data object should repres...
AST#export_declaration#Left export default AST#class_declaration#Left class PieData extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ChartData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left IPieDataSet AST#primary_type#Right AST#type_annotation#Right > AST#type_argu...
export default class PieData extends ChartData<IPieDataSet> { constructor(dataSet?: IPieDataSet) { if (dataSet) { super([dataSet]); } else { super(); } } public setDataSet(dataSet: IPieDataSet): void { if (this.mDataSets) { this.mDataSets.clear(); this.mDataSe...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieData.ets#L31-L119
cbc9f0f8f8e01e1cc00522d7fbb39ca6a3299b86
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setGranularityEnabled
Enabled/disable granularity control on axis value intervals. If enabled, the axis interval is not allowed to go below a certain granularity. Default: false @param enabled
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
AST#method_declaration#Left public setGranularityEnabled AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST...
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L409-L411
5930f8b7d2f549fa0f227668b0ba2c746b38dfcf
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BaseDataSet.ets
arkts
setColorsByArr
Sets the colors that should be used fore this DataSet. Colors are reused as soon as the number of Entries the DataSet represents is higher than the size of the colors array. You can use "new int[] { R.color.red, R.color.green, ... }" to provide colors for this method. Internally, the colors are resolved using getResour...
public setColorsByArr(colors: number[]): void { if (this.mColors == null) { this.mColors = new JArrayList <Number>(); } this.mColors.clear(); for (let color of colors) { this.mColors.add(color); } }
AST#method_declaration#Left public setColorsByArr AST#parameter_list#Left ( AST#parameter#Left colors : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation...
public setColorsByArr(colors: number[]): void { if (this.mColors == null) { this.mColors = new JArrayList <Number>(); } this.mColors.clear(); for (let color of colors) { this.mColors.add(color); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BaseDataSet.ets#L174-L183
4fb3702845be69febd1ebe2e39c90de6732f242a
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineDataSet.ets
arkts
setFillFormatter
Sets a custom IFillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. @param formatter
public setFillFormatter(formatter: IFillFormatter): void { if (!formatter) { this.mFillFormatter = new DefaultFillFormatter(); } else { this.mFillFormatter = formatter; } }
AST#method_declaration#Left public setFillFormatter AST#parameter_list#Left ( AST#parameter#Left formatter : AST#type_annotation#Left AST#primary_type#Left IFillFormatter AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void...
public setFillFormatter(formatter: IFillFormatter): void { if (!formatter) { this.mFillFormatter = new DefaultFillFormatter(); } else { this.mFillFormatter = formatter; } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineDataSet.ets#L359-L366
81e282812c0d6871ed66445917eab09846c8368a
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
addLimitLine
Adds a new LimitLine to this axis. @param l
public addLimitLine(l: LimitLine): void { this.mLimitLines.add(l); if (this.mLimitLines.size() > 6) { LogUtil.log("MPChart", "Warning! You have more than 6 LimitLines on your axis, do you really want " + "that?"); } }
AST#method_declaration#Left public addLimitLine AST#parameter_list#Left ( AST#parameter#Left l : AST#type_annotation#Left AST#primary_type#Left LimitLine AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type...
public addLimitLine(l: LimitLine): void { this.mLimitLines.add(l); if (this.mLimitLines.size() > 6) { LogUtil.log("MPChart", "Warning! You have more than 6 LimitLines on your axis, do you really want " + "that?"); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L437-L445
44b1953b42e3fde03639bb9cd816e73b8b46818c
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineRadarDataSet.ets
arkts
Base dataset for line and radar DataSets.
export default abstract class LineRadarDataSet<T extends EntryOhos> extends LineScatterCandleRadarDataSet<T> implements ILineRadarDataSet<T> { /** * the color that is used for filling the line surface */ // private mFillColor: number = Color.rgb(140, 234, 255); private mFillColor: number = ChartColor.rgb(...
AST#export_declaration#Left export default AST#class_declaration#Left abstract class LineRadarDataSet AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left EntryOhos AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Righ...
export default abstract class LineRadarDataSet<T extends EntryOhos> extends LineScatterCandleRadarDataSet<T> implements ILineRadarDataSet<T> { private mFillColor: number = ChartColor.rgb(140, 234, 255); private mLinearGradientColors: JArrayList<ChartColorStop> | null = null; protected mFillDrawable: Ch...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineRadarDataSet.ets#L27-L155
47794a08f717fa9d6faea2402be0e07a45d0a3fc
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/PieChartRenderer.ets
arkts
getSliceSpace
Calculates the sliceSpace to use based on visible values and their size compared to the set sliceSpace. @param dataSet @return
protected getSliceSpace(dataSet: IPieDataSet): number { let chartData = this.mChart.getData(); if (!chartData || !this.mViewPortHandler) { return -1; } if (!dataSet.isAutomaticallyDisableSliceSpacingEnabled()) return dataSet.getSliceSpace(); let spaceSizeRatio: number = dataSet.getSl...
AST#method_declaration#Left protected getSliceSpace AST#parameter_list#Left ( AST#parameter#Left dataSet : AST#type_annotation#Left AST#primary_type#Left IPieDataSet AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AS...
protected getSliceSpace(dataSet: IPieDataSet): number { let chartData = this.mChart.getData(); if (!chartData || !this.mViewPortHandler) { return -1; } if (!dataSet.isAutomaticallyDisableSliceSpacingEnabled()) return dataSet.getSliceSpace(); let spaceSizeRatio: number = dataSet.getSl...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/PieChartRenderer.ets#L185-L202
7ca57dd94d7ba4a82f5efffb78989d03a3dddacf
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BarEntry.ets
arkts
getPositiveSum
Reuturns the sum of all positive values this entry (if stacked) contains. @return
public getPositiveSum(): number { return this.mPositiveSum; }
AST#method_declaration#Left public getPositiveSum AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_ex...
public getPositiveSum(): number { return this.mPositiveSum; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarEntry.ets#L106-L108
ed8edfaedf864976272a700cd0116263ffb5f322
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/formatter/DefaultValueFormatter.ets
arkts
Constructor that specifies to how many digits the value should be formatted. @param digits
constructor(digits: number) { this.setup(digits); }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left digits : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#...
constructor(digits: number) { this.setup(digits); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/formatter/DefaultValueFormatter.ets#L40-L42
3ace9cf48dcd9760361189f9483204d144b2d86a
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/listener/ChartTouchListener.ets
arkts
startAction
Calls the OnChartGestureListener to do the start callback @param me
public startAction(isTouchEvent: boolean, me: TouchEvent | GestureEvent) { let l: OnChartGestureListener | null = this.mChart.getOnChartGestureListener(); if (l != null) { l.onChartGestureStart(isTouchEvent, me, this.mLastGesture); } }
AST#method_declaration#Left public startAction AST#parameter_list#Left ( AST#parameter#Left isTouchEvent : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left me : AST#type_annotation#Left AST#union_type#Left AST#primary_type#L...
public startAction(isTouchEvent: boolean, me: TouchEvent | GestureEvent) { let l: OnChartGestureListener | null = this.mChart.getOnChartGestureListener(); if (l != null) { l.onChartGestureStart(isTouchEvent, me, this.mLastGesture); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/listener/ChartTouchListener.ets#L75-L82
f07d09b1b83185c72623da8c6b78913d35abea34
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/ComponentBase.ets
arkts
setYOffset
Sets the used y-axis offset for the labels on this axis. For the legend, higher offset means the legend as a whole will be placed further away from the top. @param yOffset
public setYOffset(yOffset: number): void { this.mYOffset = Utils.handleDataValues(yOffset); }
AST#method_declaration#Left public setYOffset AST#parameter_list#Left ( AST#parameter#Left yOffset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_typ...
public setYOffset(yOffset: number): void { this.mYOffset = Utils.handleDataValues(yOffset); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/ComponentBase.ets#L90-L92
d57e75aae432299d8aa21189793a912d56bf5ea6
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/formatter/DefaultValueFormatter.ets
arkts
setup
Sets up the formatter with a given number of decimal digits. @param digits
public setup(digits: number): void { this.mDecimalDigits = digits; }
AST#method_declaration#Left public setup AST#parameter_list#Left ( AST#parameter#Left digits : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Righ...
public setup(digits: number): void { this.mDecimalDigits = digits; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/formatter/DefaultValueFormatter.ets#L49-L52
0826cbec39fdb62a141609bd42fa420f2ddcf47d
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/Utils.ets
arkts
calcTextWidth
calculates the approximate width of a text, depending on a demo text avoid repeated calls (e.g. inside drawing methods) @param paint @param demoText @return
public static calcTextWidth(paint: Paint, demoText: string): number { Utils.resetContext2DFont(Utils.offCanvasContext2d, paint); let textMetrics: TextMetrics = Utils.offCanvasContext2d.measureText(demoText); return textMetrics.width; }
AST#method_declaration#Left public static calcTextWidth AST#parameter_list#Left ( AST#parameter#Left paint : AST#type_annotation#Left AST#primary_type#Left Paint AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left demoText : AST#type_annotation#Left AST#primary_type#Left string AST...
public static calcTextWidth(paint: Paint, demoText: string): number { Utils.resetContext2DFont(Utils.offCanvasContext2d, paint); let textMetrics: TextMetrics = Utils.offCanvasContext2d.measureText(demoText); return textMetrics.width; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Utils.ets#L78-L82
53d43ffa708b9a89870e0ee3bc1d878aa9d3e588
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BarDataSet.ets
arkts
getBarBorderColor
Returns the color drawing borders around the bars. @return
public getBarBorderColor(): number { return this.mBarBorderColor; }
AST#method_declaration#Left public getBarBorderColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member...
public getBarBorderColor(): number { return this.mBarBorderColor; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L262-L264
54ccaf7fb19a0d0c6f76b2f8e1efe2ccfc6fa40f
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/Rect.ets
arkts
width
@return the rectangle's width. This does not check for a valid rectangle (i.e. left <= right) so the result may be negative.
public width(): number { return this.right - this.left; }
AST#method_declaration#Left public width AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#...
public width(): number { return this.right - this.left; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L94-L96
069022ce950cbd31a3d07e65088ccad184d97032
gitee
End of preview.

No dataset card yet

Downloads last month
37