Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle gauge add real time values #241

Open
Krishnaranji opened this issue Dec 22, 2021 · 1 comment
Open

Circle gauge add real time values #241

Krishnaranji opened this issue Dec 22, 2021 · 1 comment

Comments

@Krishnaranji
Copy link

Krishnaranji commented Dec 22, 2021

if i give static value from demo app, it's work fine. if i add multiple data using real time values, circle gauge graph can draw graph using values, but cannot create background transparent circle.

String[] str = new String[sample.size()];
for (int k = 0; k < sample.size(); k++) {
if (!sample.get(k).getValue().isEmpty())
str[k] = sample.get(k).getValue();
}

SingleValueDataSet dataSet = new SingleValueDataSet(str);
circularGauge.data(dataSet);

and then

circularGauge.label(0d)
.text("Temazepam, <span style="">32%")
.useHtml(true)
.hAlign(HAlign.CENTER)
.vAlign(VAlign.MIDDLE);
circularGauge.label(0d)
.anchor(Anchor.RIGHT_CENTER)
.padding(0d, 10d, 0d, 0d)
.height(17d / 2d + "%")
.offsetY(100d + "%")
.offsetX(0d);
Bar bar0 = circularGauge.bar(0d);
bar0.dataIndex(0d);
bar0.radius(100d);
bar0.width(17d);
bar0.fill(new SolidFill("#64b5f6", 1d));
bar0.stroke(null);
bar0.zIndex(5d);

    Bar bar100 = circularGauge.bar(100d);
    bar100.dataIndex(5d);
    bar100.radius(100d);
    bar100.width(17d);
    bar100.fill(new SolidFill("#F5F4F4", 1d));
    bar100.stroke("1 #e5e4e4");
    bar100.zIndex(4d);

that bar100 value is not created.

anyone help me how to add background transparent layer circle dynamically.

@Shestac92
Copy link

@Krishnaranji
Make sure that you apply data for the bar100. It has a data index 5d.
For details, check the sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants