Giter VIP home page Giter VIP logo

highcharts-android's Introduction

Highcharts JS is a JavaScript charting library based on SVG and some canvas/WebGL.

Highcharts is a source available product. Please refer to shop.highcharts.com for details on licensing.

Installing and using Highcharts

This is the working repo for Highcharts code. If you simply want to include Highcharts into a project, use the distribution package instead, or read the download page.

Please note that there are several ways to use Highcharts. For general installation instructions, see the docs.

Use our CDN

Instead of downloading, you can use our CDN to access files directly. See code.highcharts.com for details.

<script src="https://code.highcharts.com/highcharts.js"></script>

Install from npm

See npm documentation on how to get started with npm.

npm install --save highcharts

ES6 modules, AMD, CommonJS and others

For other ways to use Highcharts in your projects, please refer to our installation docs.

Create your own custom build of Highcharts

To reduce file size, or combine modules into one file to reduce latency, you may want to create your own build of the Highcharts modules. See Creating custom Highcharts files for more information.

Build and debug

If you want to do modifications to Highcharts or fix issues, you may build your own files. Highcharts uses Gulp as the build system. After npm install in the root folder, run gulp, which will set up a watch task for the JavaScript and CSS files. Now any changes in the files of the /js or /css folders will result in new files being built and saved in the code folder. Other tasks are also available, like gulp lint.

npm install
gulp

Node setup for Apple Mx CPU

When running Node natively on ARM64 MacOS, some Node packages like node-canvas with integrated compiling might fail. Install additional tools to resolve the problem:

  • Homebrew and run brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman

Generate API docs

Run in this highcharts repository the doc generator with npx gulp jsdoc-watch, which also starts a new server with the generated API documentation.

highcharts-android's People

Contributors

mikolajmichalczak avatar mll avatar soommy12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

highcharts-android's Issues

i get error: cannot find symbol variable type,plotBackgroundColor,plotBorderWidth,plotShadow,chart ,pointFormat,tooltip,pie etc

i used highcharts lib opetion 'A'.But i get some error like error: cannot find symbol variable type,plotBackgroundColor,plotBorderWidth,plotShadow,chart ,pointFormat,tooltip,pie etc all the veriable can't find.so plz tell me how to resolve that error.
eg:-
Error:(52, 20) error: cannot find symbol variable pie
Error:(45, 16) error: cannot find symbol variable tooltip
Error:(48, 20) error: cannot find symbol variable pie
Error:(90, 18) error: cannot find symbol variable options
Error:(34, 14) error: cannot find symbol variable plotBackgroundColor
Error:(50, 20) error: cannot find symbol variable pie
Error:(49, 20) error: cannot find symbol variable pie
Error:(85, 16) error: cannot find symbol variable data
Error:(54, 16) error: cannot find symbol variable plotOptions
Error:(35, 14) error: cannot find symbol variable plotBorderWidth
Error:(44, 16) error: cannot find symbol variable pointFormat
Error:(36, 14) error: cannot find symbol variable plotShadow
Error:(41, 16) error: cannot find symbol variable title
Error:(53, 20) error: cannot find symbol variable pie
Error:(57, 16) error: cannot find symbol variable name
Error:(51, 20) error: cannot find symbol variable pie
Error:(40, 14) error: cannot find symbol variable text
Error:(37, 16) error: cannot find symbol variable chart
Error:(87, 16) error: cannot find symbol variable series
Error:(33, 14) error: cannot find symbol variable type

How to invoke the HIFunction programmatically

Hi,
How to do the click event in the specified index programmatically, for example if i click on the chart HIEvents will be trigger and HIFunction will be call. Exactly the same process I want to in programmatically.

Please tell the possible way to achieve this.
Thanks.

HighCharts Export Options

Hi,
I was looking through the sample application provided by highcharts and when i click on export options in a chart it showed a share action.Can you please help me how to add a click event for that export options?
Thanks in advance!

How to reload the chart view with new values

Hi have create the chart the with default values, When user picks Any option from the menu I want to recreate the chart with new values and styles. For that I have created one separate class and passing the HIOption. When I set like this ChartView.setOptions(Option); its not reloading the chart view. It shows the old values and styles. Could you please tell me how to achieve that ?

Data time scope

Hey,
Iv data for 3 months.
and i want the user to be able to choose between 24 hours, 7 days and 1 month view.
how can i do it?

Thank you!
Niv

how to get the chart selection index

Hi I have a chart which contain 2 HILine and 2 HIColumn if I click on the chart in any position I want to get the exact index of all chart values. Could you please tell me how to get the values.

Thanks.

FATAL EXCEPTION

I have a fragment which shows HighChart - bar example .
In runtime it shows

java.util.NoSuchElementException: HIOptions not found in HIChartView

   ```
    HIChartView hiChartView = (HIChartView) high_chart_view.findViewById(R.id.high_chart);

    HIOptions hiOptions = new HIOptions();

    HIChart chart = new HIChart();
    chart.setType("bar");
    hiOptions.setChart(chart);

    HITitle hiTitle = new HITitle();
    hiTitle.setText("Historic World Population by Region");
    hiOptions.setTitle(hiTitle);

    HISubtitle hiSubtitle = new HISubtitle();
    hiSubtitle.setText("Source: abcyz");
    hiOptions.setSubtitle(hiSubtitle);

    final HIXAxis hixAxis = new HIXAxis();
    String[] categories = new String[] { "Africa", "America", "Asia", "Europe", "Oceania"};
    hixAxis.setCategories(new ArrayList<>(Arrays.asList(categories)));
    hiOptions.setXAxis(new ArrayList<HIXAxis>(){{add(hixAxis);}});

    final HIYAxis hiyAxis = new HIYAxis();
    hiyAxis.setMin(0);
    hiyAxis.setTitle(new HITitle());
    hiyAxis.getTitle().setText("Population");
    hiyAxis.getTitle().setAlign("high");
    hiyAxis.setLabels(new HILabels());
    hiyAxis.getLabels().setOverflow("justify");
    hiOptions.setYAxis(new ArrayList<HIYAxis>(){{add(hiyAxis);}});

    HITooltip tooltip = new HITooltip();
    tooltip.setValueSuffix("millions");
    hiOptions.setTooltip(tooltip);

    HIPlotOptions plotOptions = new HIPlotOptions();
    plotOptions.setBar(new HIBar());
    plotOptions.getBar().setDataLabels(new HIDataLabels());
    plotOptions.getBar().getDataLabels().setEnabled(true);
    hiOptions.setPlotOptions(plotOptions);

    HILegend legend = new HILegend();
    legend.setLayout("vertical");
    legend.setAlign("right");
    legend.setVerticalAlign("top");
    legend.setX(-40);
    legend.setY(80);
    legend.setFloating("true");
    legend.setBorderWidth(1);
    legend.setBackgroundColor(HIColor.initWithHexValue("FFFFFF"));
    legend.setShadow(true);
    hiOptions.setLegend(legend);

    HICredits credits = new HICredits();
    credits.setEnabled(false);
    hiOptions.setCredits(credits);

    HIBar hiBar = new HIBar();
    hiBar.setName("Year 1880");

    Number[] bar1Data = new Number[] {107, 31, 635, 203, 2 };
    hiBar.setData(new ArrayList(Arrays.asList(bar1Data)));

    HIBar bar2 = new HIBar();
    bar2.setName("Year 1900");
    Number[] bar2Data = new Number[] { 133, 156, 947, 408, 6 };
    bar2.setData(new ArrayList<>(Arrays.asList(bar2Data)));


    HIBar bar3 = new HIBar();
    bar3.setName("Year 2012");
    Number[] bar3Data = new Number[] { 1052, 954, 4250, 740, 38 };
    bar3.setData(new ArrayList<>(Arrays.asList(bar3Data)));

    ArrayList<HISeries> obj= new ArrayList<>();
    HISeries hiSeries = new HISeries();
    hiSeries.setData(new ArrayList<>(Arrays.asList(bar2, hiBar,bar3)));
    obj.add(hiSeries);
    hiOptions.setSeries(obj);
    hiChartView.setOptions(hiOptions);

Please help me regarding this issue


Custom Tooltip

Hey, im trying to customise the tooltip in two ways.

  1. try to add margin between tooltip and the marker by "setPositioner" but cants get the "point" -
    HighChartsHelper.format(new HIFunctionInterface<HIChartContext, HashMap<String, Object>>() { @Override public HashMap<String, Object> apply(HIChartContext hiChartContext) { HashMap<String, Object> map = new map.put("x", 0); return map; } }, "point)

when debugging the HIChartContext the "point" is null.

  1. how can i set fully custom text? (different font, color, 2 lines)

Thank you for your help!

Best regards, Niv

Setting a transparent background seems impossible

I'm trying to set a transparent background.
I tried :

  • options.chart.backgroundColor = HIColor.initWithRGBA(255, 255, 255, 0.0);

  • options.chart.plotBackgroundColor = HIColor.initWithRGBA(255, 255, 255, 0.0);

  • setBackgroundColor(Color.TRANSPARENT); // on the HIChartView object

  • android:background="@null", on the layout of the view

Nothing of them works I all display a white background. Any idea of how to set a transparent background?

HIChartView Not working with Android Data Binding

Below class is auto generated by android studio when i use HiChartView with android data binding .

When i clicking build button I am getting this error -
"Symbol not found Core"

Things i noticed
1 . auto generated import statement is incorrect
import com.highsoft.highcharts.Core; // HIChartView is missing after Core.

  1. auto generated object data type is incorrect
    public final Core.HIChartView chart; // No need of Core. before HIChartView

  2. Android data binding compiler may confused with the name Core "C" was a capital letter so compiler may assumed that it is a class name, Actually it is package.
    Its only my assumption I am not a big giant in coding

Changing package name Core into core may fix this issue. Please help me .


import android.databinding.Bindable;
import android.databinding.DataBindingComponent;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.highsoft.highcharts.Core;

public abstract class ActivityMainGraphBinding extends ViewDataBinding {
 @NonNull
 public final CardView card2;

 @NonNull
 public final Core.HIChartView chart;

 @Bindable
 protected BoxLayout mBox;

 protected ActivityMainGraphBinding(DataBindingComponent _bindingComponent, View _root,
     int _localFieldCount, CardView card2, Core.HIChartView chart) {
   super(_bindingComponent, _root, _localFieldCount);
   this.card2 = card2;
   this.chart = chart;
 }

 public abstract void setBox(@Nullable BoxLayout box);

 @Nullable
 public BoxLayout getBox() {
   return mBox;
 }

 @NonNull
 public static ActivityMainGraphBinding inflate(@NonNull LayoutInflater inflater,
     @Nullable ViewGroup root, boolean attachToRoot) {
   return inflate(inflater, root, attachToRoot, DataBindingUtil.getDefaultComponent());
 }

 @NonNull
 public static ActivityMainGraphBinding inflate(@NonNull LayoutInflater inflater,
     @Nullable ViewGroup root, boolean attachToRoot, @Nullable DataBindingComponent component) {
   return DataBindingUtil.<ActivityMainGraphBinding>inflate(inflater, com.tiatech.numr.R.layout.box_graph, root, attachToRoot, component);
 }

 @NonNull
 public static ActivityMainGraphBinding inflate(@NonNull LayoutInflater inflater) {
   return inflate(inflater, DataBindingUtil.getDefaultComponent());
 }

 @NonNull
 public static ActivityMainGraphBinding inflate(@NonNull LayoutInflater inflater,
     @Nullable DataBindingComponent component) {
   return DataBindingUtil.<ActivityMainGraphBinding>inflate(inflater, com.tiatech.numr.R.layout.box_graph, null, false, component);
 }

 public static ActivityMainGraphBinding bind(@NonNull View view) {
   return bind(view, DataBindingUtil.getDefaultComponent());
 }

 public static ActivityMainGraphBinding bind(@NonNull View view,
     @Nullable DataBindingComponent component) {
   return (ActivityMainGraphBinding)bind(component, view, com.tiatech.numr.R.layout.box_graph);
 }
}


Show HiMarker only for the last x data

Hey,

Im trying to add marker for the last point on x axis.
there is a way to achieve this?

i tried to add object to the data -

`public class ChartData extends ArrayList {

private Number y;
private Number x;
private HIMarker marker;

public ChartData(Number y, Number x, HIMarker marker) {
    this.x = x;
    this.y = y;
    this.marker = marker;

    add(x);
    add(y);
    add(marker);
}

}
`

Thank you,

Niv

HIchartView click function not working

Hi,

According to my concept I am using multiple options with different data, during the runtime I reload the data with new options. When i did like that my chart click function is not working

spline.setPoint(new HIPoint());
spline.getPoint().setEvents(new HIEvents());
spline.getPoint().getEvents().setClick(new HIFunction(
        f -> {
            Toast t = Toast.makeText(
                this,
                "Clicked point [ " + f.getProperty("x") + ", " + f.getProperty("y") + " ]",
                Toast.LENGTH_SHORT);
                t.show();
            },
            new String[] {"x", "y"}
));

Could you please tell me how to solve this.

Thanks

How To Use HILang

Hi, I wanna use HIlang

HILang hiLang = new HILang();
hiLang.setThousandsSep(".");
hiLang.setDecimalPoint(",");

where i can set to options or to the charts?

Is that possible to provide constants variable

Hi,
I found that some method like setZoomType, setLayout, setAlign, all these methods need a string
variable as param.

For those specified string, is that possible to provide the constant in their class?(Like HILegend.LAYOUT_VERTICAL, etc.)

Thanks.

plot series are behind each other

For some reason it stacks on each other, in a way so it looks like the series stacks behind each other and blends the colors of the series together. Also the marker in the 2nd series looks like it's behind the first series. I have 3 images to illustrate the problem:

skaermbillede 2019-01-02 kl 19 17 10

skaermbillede 2019-01-02 kl 19 22 47

skaermbillede 2019-01-02 kl 19 23 03

CO2 serie is not currently working.

Is there a way to make the colors of the plots not to blend in with each other, so I can see the selected colors for each series?

highcharts with Retrofit async data load

Hi,

I'm trying to use highcharts inside RecyclerView. I need to show a list of spline charts and every chart is initialised inside a separate ViewHolder. I get highcharts view when ViewHolder is created:
mItemHighcharts = itemView.findViewById(R.id.item_highcharts);
Then I add data when ViewHolder is binded:
HISpline series = new HISpline(); series.setColor(HIColor.initWithRGB(0x4C, 0xAF, 0x50)); series.setShowInLegend(false); series.setEnableMouseTracking(false); series.setData(new ArrayList<>(Arrays.asList(0.3,5.3,8.0,9.1,3.2,5.4,4.0,4.2,2.1,10.0))); HIOptions options = mItemHighcharts.getOptions(); options.setSeries(new ArrayList<HISeries>(Collections.singletonList(series))); mItemHighcharts.setOptions(options); mItemHighcharts.reload();
And everything works fine when I add series with static data. But when I try to load data from API using Retrofit 2 and add it to the chart exactly the same way but in a Retrofit callback, some mysterious things start to happen. Data is not shown in charts and I get this messages in the log:
2018-11-12 12:58:43.125 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: updateOptions is not defined
2018-11-12 12:58:43.127 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: Highcharts is not defined
2018-11-12 12:58:43.132 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: updateOptions is not defined
2018-11-12 12:58:43.133 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: Highcharts is not defined
2018-11-12 12:58:43.138 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: updateOptions is not defined
2018-11-12 12:58:43.140 8731-8731/com.thingenix.tngxio E/libHC: Uncaught ReferenceError: Highcharts is not defined

If I start scrolling down through the charts, the new charts which appear load data just fine and show it, but some of them are still empty and cause the same messages in the log. When I scroll back to the start of the chart list, first charts which happened to be empty are populated with data.

This only happens when data is added in Retrofit 2 callback.
Any ideas on what can cause it?

Setting UTC is invalid.

HITime hiTime = new HITime();
hiTime.setUseUTC(false);
hiOptions.setTime(hiTime);


The HIOptions setting UTC is invalid.

How to enable the marker which is presented in the chart

Hi,

Am using two HILine in a chart, When i click on the chart I wanted to highlight both HILine's marker at the same index also I have to show plotband in the same index place . My requirement is to highlight the markers which is presented in the chart not to the selected line. Could you please tell me how to achieve that.

Thanks.

How to catch onClick(onTouch) event on graph module outside the object.

Hello,

I have graph module in Recycleview.ViewHolder as a small preview and on click(with no interaction in the graph), I want to show fullscreen version (or call any of my functions).

Unfortunately, I can not find the way how to catch onClick event on the whole module in Recycleview outside the graph object. On touch listener on viewHolder or HIChartView module is not called after click or touch, also descendantFocusability, clickable, focusable, enabled does nothing.

Please is there a way how to completely disable user interaction on the graph and catch the event outside the graph object?

Thank you,
Zuzana

java.lang.ClassCastException: java.lang.String cannot be cast to com.highsoft.highcharts.Common.HIColor

java.lang.ClassCastException: java.lang.String cannot be cast to com.highsoft.highcharts.Common.HIColor
at com.highsoft.highcharts.Common.HIChartsClasses.HIColumn.getParams(SourceFile:326)
at com.highsoft.highcharts.Common.HIChartsClasses.HIOptions.getParams(SourceFile:582)
at com.highsoft.highcharts.Core.HIChartView.b(SourceFile:242)
at com.highsoft.highcharts.Core.HIChartView.reload(SourceFile:257)
at monitoring_analytic.cartenz.com.landing.category.penerimaan.progressCapaianTarget.ProgressCapaianTargetFragment.updateChart(ProgressCapaianTargetFragment.java:274)
at monitoring_analytic.cartenz.com.landing.category.penerimaan.progressCapaianTarget.ProgressCapaianTargetFragment.getDataResponse(ProgressCapaianTargetFragment.java:282)
at cartenz.com.tax_analytics_network.potensi.RepoPotensi$14.onResponse(RepoPotensi.java:379)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6361)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

highchats add plot line in xaxis base line

Hi,

Please tell me how to draw the plot Line in xAxis base line, Which means the zeroth position of xAxis. I found the below code in javascript the same I want to achieve in android

xAxis: {
categories: [
'Week 1',
'Week 2',
'Week 3',
'Week 4',
'Week 5',
'Week 6',
'Week 7',
'Week 8'],
plotLines: [{
color: '#FF0000',
width: 1,
value: 0,
dashStyle: "dash"
}]

here you can see the plot line was added in the xAxis with values, For reference please check this link http://jsfiddle.net/phpdeveloperrahul/gm74d/

Error:Failed to resolve: com.highsoft.highcharts:6.0.2:

I am using Android Studio 3.0.1 & when i added

dependencies {
compile 'com.highsoft.highcharts:6.0.2'
}

As mentioned in the document i'm getting this error

  Error:Failed to resolve: com.highsoft.highcharts:6.0.2:
  <a href="openFile:D:/Other Projects/HighCharts2/app/build.gradle">Open File</a>

I also tried with add .aar file to libs that time
HIGChartView chartView = (HIGChartView) findViewById(R.id.hc);

not able to resolve..... HIGChartView i also downloaded you project by github & the app is runnig without issue but why problem with my project.

Scroll in horizontal when scale

Hi,
It's not able to scroll horizontal after I scale the chart.
I have set the HIScrollablePlotArea with minWidth, but it performs strange and still not work when scaled.
Is there any advice?
Thanks!

Changing color of y-axis values and x-axis values

Hi, thanks for the library!
I have issues in changing the color of y-axis values, x-axis values and the text color of the dot + text:

As you can see here, you can not see the x-axis and y-axis values and the text next to the dot is black, but i need it to be grey_300:

skaermbillede 2018-12-22 kl 15 53 38

If it's possible I also need to deactivate the inactive mode, so that it doesn't go inactive on click.

HIStyle Deprecated

Hi I am using HIStyle for Chart styling, in 6.2 version it has been deprecated, Instead it ask us use HICSSObject but it's not working properly,

In the below code snippet the style is not applying to the to the HITitle class

 ```
   HICSSObject ChartTitleStyle = new HICSSObject();
    ChartTitleStyle.setColor("black");
    ChartTitleStyle.setFontSize("11px");
    ChartTitleStyle.setFontFamily("Arial");

   HITitle ChartTitle = new HITitle();
    ChartTitle.setText("Welcome");
    ChartTitle.setStyle(ChartTitleStyle);

HIOptions not found in HIChartView

Expected behaviour

Actual behaviour

java.util.NoSuchElementException: HIOptions not found in HIChartView

Live demo with steps to reproduce

Product version

6.1.1

Affected android

How to remove the "Export" menu from the chart

I can see that, by default, the export top right menu icon is displayed.
I have constructed the exact same options object that I use on the web version, but I'm still having the export menu icon displayed on Android, whereas it is not displayed on the web version.
How to remove it?
I tried options.exporting = null; and options.navigation = null; but none of them changed the result, as, by default, both fields are already null.
Thanks.

How to show more than two HITooltip.

I am using https://www.highcharts.com/android/demo/column-rotated-labels graph & i wanna set 4 HITooltip when i tap on graph it will show.

Documentation Code

HITooltip tooltip = new HITooltip();
        tooltip.pointFormat = "Population in'2008': <b>{point.y:.1f} millions</b>";
        options.tooltip = tooltip;

My Code

 HITooltip tooltip = new HITooltip();
        tooltip.pointFormat = "Remaining Quantity': <b>{point.y:.2f}</b> <br> Time Left for Soldout': <b>{point.y:.2f}</b> <br> Velocity': <b>{point.y:.2f}</b> <br> Sold qty': <b>{point.y:.2f}</b>";
        options.tooltip = tooltip;

Now by using above code i am able to show four tooltip but how can i change the value of all these, now i am using {point.y:.2f} for all. More than 10 graph line are showing in my case , how can i show different values for all.

Asking HIFunction

Hi, if I want to make thousand separator from HIFunction can i make like this?

HITooltip tooltip = new HITooltip();
tooltip.setFormatter(new HIFunction("function(x, thousandSeparator){ var decimalPoint = thousandSeparator == '.' ? ',' : '.'; var newVal = x.toFixed(2).toString().replace(thousandSeparator, decimalPoint); return newVal.replace(/\B(?=(\d{3})+(?!\d))/g, thousandSeparator); } function() {return {point.name} : thousandSeparatorsWithoutDecimal({point.y}, '.');}"));
options.setTooltip(tooltip);

i want to make thousandSeparator for tooltip, is it i need declare 2 function? and if need declare 2 function. how i can put the param n get value from?

Advertisement

Why do pop-ups sometimes pop up?What should I do?

1
Uploading 2.jpg…

Failed to resolve: com.highsoft.highcharts:highcharts:7.0.1

Hi,

I am new on using the library and we are trying if it fits our need. I have written compile 'com.highsoft.highcharts:highcharts:7.0.1' in app gradle dependencies part and tried to sync but I took the error : Failed to resolve: com.highsoft.highcharts:highcharts:7.0.1

Any idea? I am waiting for quick responses,

Thanks

How to add arrayList object to HighCharts

**I am using ** https://www.highcharts.com/android/demo/column-rotated-labels
As documentation data added as below

        Object[] object1 = new Object[] { "Shanghai", 23.7 };
        Object[] object2 = new Object[] { "Lagos", 16.1 };
        Object[] object3 = new Object[] { "Istanbul", 14.2 };
        Object[] object4 = new Object[] { "Karachi", 14 };
        Object[] object5 = new Object[] { "Mumbai", 12.5 };

       series1.data = new ArrayList<>(Arrays.asList(object1, object2, object3, object4, object5));

What i want to add

` ArrayList<Top_10_BouquitShowPojo> myList = new ArrayList<>();
        Top_10_BouquitShowPojo list = new Top_10_BouquitShowPojo("Abhishek",27);
         myList .add(new Top_10_BouquitShowPojo("Shanghai",23.7));
        myList .add(new Top_10_BouquitShowPojo("Lagos",16.1 ));
        myList .add(new Top_10_BouquitShowPojo("Mumbai",75));
        myList .add(new Top_10_BouquitShowPojo("Delhi",16.1 ));`

i want to add myList , Please help me how can i add this.

Crash when attempting to set HIOptions.colors

Device

Nexus 6 API 27 Emulator

Code that produces the crash (if commented there is no crash and chart is displayed)

options.colors = new ArrayList<>();
options.colors.add(HIColor.initWithRGB(255, 0, 0));
options.colors.add(HIColor.initWithRGB(0, 0, 255));

Stack trace

java.lang.ClassCastException: java.lang.String cannot be cast to com.highsoft.highcharts.Common.HIColor
                                                                  at com.highsoft.highcharts.Common.HIChartsClasses.HIOptions.getParams(HIOptions.java:363)
                                                                  at com.highsoft.highcharts.Core.HIChartView.loadChartHtml(HIChartView.java:206)
                                                                  at com.highsoft.highcharts.Core.HIChartView.onDraw(HIChartView.java:184)
                                                                  at android.view.View.draw(View.java:19192)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18142)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.draw(View.java:19195)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18142)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18133)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.draw(View.java:19195)
                                                                  at android.widget.ScrollView.draw(ScrollView.java:1739)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18142)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18133)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18133)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18133)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18133)
                                                                  at android.view.View.draw(View.java:18920)
                                                                  at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
                                                                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
                                                                  at android.view.View.draw(View.java:19195)
                                                                  at com.android.internal.policy.DecorView.draw(DecorView.java:788)
                                                                  at android.view.View.updateDisplayListIfDirty(View.java:18142)
                                                                  at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:669)
                                                                  at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:675)
                                                                  at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:783)
                                                                  at android.view.ViewRootImpl.draw(ViewRootImpl.java:2992)
                                                                  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2806)
                                                                  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2359)
                                                                  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
                                                                  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
                                                                  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
                                                                  at android.view.Choreographer.doCallbacks(Choreographer.java:723)
                                                                  at android.view.Choreographer.doFrame(Choreographer.java:658)
                                                                  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
                                                                  at android.os.Handler.handleCallback(Handler.java:790)
                                                                  at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                  at android.os.Looper.loop(Looper.java:164)
                                                                  at android.app.ActivityThread.main(ActivityThread.java:6494)
                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

HIOptions Not Found in HIChartView

here's the error code:

Process: monitoring_analytic.test.com, PID: 22751
java.util.NoSuchElementException: HIOptions not found in HIChartView
at com.highsoft.highcharts.Core.HIChartView.a(SourceFile:262)
at com.highsoft.highcharts.Core.HIChartView.a(SourceFile:190)
at com.highsoft.highcharts.Core.HIChartView.onDraw(SourceFile:182)
at android.view.View.draw(View.java:17211)
at android.view.View.updateDisplayListIfDirty(View.java:16193)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1966)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.updateDisplayListIfDirty(View.java:16188)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild(ViewGroup.java:3729)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3515)
at android.view.View.draw(View.java:17214)
at com.android.internal.policy.DecorView.draw(DecorView.java:757)
at android.view.View.updateDisplayListIfDirty(View.java:16193)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:648)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:654)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:762)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2842)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2650)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2257)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1296)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6401)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:876)
at android.view.Choreographer.doCallbacks(Choreographer.java:688)
at android.view.Choreographer.doFrame(Choreographer.java:623)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:862)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6361)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

Add new HiLine and opposite Yaxis dynamically

Hello,
Im trying to add another HILine to exists chart (already initialised) and opposite Yaxis to it.

// options are from the exists chart.
` HILabels yLablesCompare = new HILabels();
HIYAxis Yaxis = new HIYAxis();
Yaxis.setOpposite(true);
Yaxis.setLabels(yLablesCompare);
options.getYAxis().add(Yaxis);

    HILine line = new HILine();
    line.setData(data);
    line.setYAxis(1);
    options.getSeries().add(line);`

after adding im calling -
vChart.reload()

Im getting "Uncaught ReferenceError: Highcharts is not defined" error.
and the chart is disappear.

Thanks for your help!

Readme error

HIGChartView ==> HIChartView

<com.highsoft.highcharts.Core.HIGChartView
   android:id="@+id/hc"
   android:layout_width="match_parent"
   android:layout_height="match_parent" />

java.util.NoSuchElementException: HIOptions not found in HIChartView

HIChartView chartView = dialog.findViewById(R.id.hc);

            HIOptions options = new HIOptions();

            HIChart chart = new HIChart();
            chart.setType("column");
            options.setChart(chart);

            HITitle title = new HITitle();
            title.setText("Demo chart");
            options.setTitle(title);

            HIColumn series = new HIColumn();
            series.setData(new ArrayList<>(Arrays.asList(49.9, 71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4)));
            options.setSeries(new ArrayList<HISeries>(Collections.singletonList(series)));

            chartView.setOptions(options);

Exception for HighChart in Viewstub !!! - java.util.NoSuchElementException: HIOptions not found in HIChartView

I have custom expandable cardview in which I want to show HighChart as expanded panel. For this I used the ViewStub to inflate the HighChart Layout. But on runtime it gives me "java.util.NoSuchElementException: HIOptions not found in HIChartView" exception.

My Custom Expandable Cardview ->

`public class ExpandableCardViewHelper extends LinearLayout {

private String title;

private View innerView;
private ViewGroup containerView;

private ImageButton arrowBtn;
private ImageButton headerIcon;
private TextView textViewTitle;

private TypedArray typedArray;
private int innerViewRes;
private Drawable iconDrawable;

private MaterialCardView card;

public static final int DEFAULT_ANIM_DURATION = 350;
private long animDuration = DEFAULT_ANIM_DURATION;

private final static int COLLAPSING = 0;
private final static int EXPANDING = 1;

private boolean isExpanded = false;
private boolean isExpanding = false;
private boolean isCollapsing = false;
private boolean expandOnClick = false;
private boolean startExpanded = false;

private int previousHeight = 0;

private OnExpandedListener listener;

public ExpandableCardViewHelper(Context context) {
    super(context);
}

public ExpandableCardViewHelper(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    initAttributes(context, attrs);
    initView(context);
}

public ExpandableCardViewHelper(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    initAttributes(context, attrs);
    initView(context);
}

public ExpandableCardViewHelper(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
}

private void initView(Context context){
    //Inflating View
    LayoutInflater inflater = (LayoutInflater) context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.item_expandable_cardview, this);
}

private void initAttributes(Context context, AttributeSet attrs){
    //Ottengo attributi
    typedArray = context.obtainStyledAttributes(attrs, R.styleable.ExpandableCardView);
    title = typedArray.getString(R.styleable.ExpandableCardView_title);
    iconDrawable = typedArray.getDrawable(R.styleable.ExpandableCardView_icon);
    innerViewRes = typedArray.getResourceId(R.styleable.ExpandableCardView_inner_view, View.NO_ID);
    expandOnClick = typedArray.getBoolean(R.styleable.ExpandableCardView_expandOnClick, false);
    animDuration = typedArray.getInteger(R.styleable.ExpandableCardView_animationDuration, DEFAULT_ANIM_DURATION);
    startExpanded = typedArray.getBoolean(R.styleable.ExpandableCardView_startExpanded, false);
    typedArray.recycle();
}

@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    //Una volta che la view è inflatata setto tutto

    arrowBtn = findViewById(R.id.arrow);
    textViewTitle = findViewById(R.id.title);
    headerIcon = findViewById(R.id.icon);

    //Setting attributes
    if(!TextUtils.isEmpty(title)) textViewTitle.setText(title);

    if(iconDrawable != null){
        headerIcon.setVisibility(VISIBLE);
        headerIcon.setBackground(iconDrawable);
    }

    card = findViewById(R.id.card);

    setInnerView(innerViewRes);

    containerView = findViewById(R.id.viewContainer);

    setElevation(DisplayMeasurementUtils.convertDpToPixels(getContext(), 4));

    if(startExpanded){
        setAnimDuration(0);
        expand();
        setAnimDuration(animDuration);
    }

    if(expandOnClick){
        textViewTitle.setOnClickListener(defaultClickListener);
        arrowBtn.setOnClickListener(defaultClickListener);
    }

}

public void expand() {

    final int initialHeight = card.getHeight();

    if(!isMoving()) {
        previousHeight = initialHeight;
    }

    card.measure(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    int targetHeight = card.getMeasuredHeight();

    if(targetHeight - initialHeight != 0) {
        animateViews(initialHeight,
                targetHeight - initialHeight,
                EXPANDING);
    }
}

public void collapse() {
    int initialHeight = card.getMeasuredHeight();

    if(initialHeight - previousHeight != 0) {
        animateViews(initialHeight,
                initialHeight - previousHeight,
                COLLAPSING);
    }

}

public boolean isExpanded() {
    return isExpanded;
}

private void animateViews(final int initialHeight, final int distance, final int animationType){

    Animation expandAnimation = new Animation() {
        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            if (interpolatedTime == 1){
                //Setting isExpanding/isCollapsing to false
                isExpanding = false;
                isCollapsing = false;

                if(listener != null){
                    if(animationType == EXPANDING){
                        listener.onExpandChanged(card,true);
                    }
                    else{
                        listener.onExpandChanged(card,false);
                    }
                }
            }

            card.getLayoutParams().height = animationType == EXPANDING ? (int) (initialHeight + (distance * interpolatedTime)) :
                    (int) (initialHeight  - (distance * interpolatedTime));
            card.findViewById(R.id.viewContainer).requestLayout();

            containerView.getLayoutParams().height = animationType == EXPANDING ? (int) (initialHeight + (distance * interpolatedTime)) :
                    (int) (initialHeight  - (distance * interpolatedTime));

        }

        @Override
        public boolean willChangeBounds() {
            return true;
        }
    };

    RotateAnimation arrowAnimation = animationType == EXPANDING ?
            new RotateAnimation(0,180,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                    0.5f) :
            new RotateAnimation(180,0,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                    0.5f);

    arrowAnimation.setFillAfter(true);


    arrowAnimation.setDuration(animDuration);
    expandAnimation.setDuration(animDuration);

    isExpanding = animationType == EXPANDING;
    isCollapsing = animationType == COLLAPSING;

    startAnimation(expandAnimation);
    Log.d("SO","Started animation: "+ (animationType == EXPANDING ? "Expanding" : "Collapsing"));
    arrowBtn.startAnimation(arrowAnimation);
    isExpanded = animationType == EXPANDING;

}

private boolean isExpanding(){
    return isExpanding;
}

private boolean isCollapsing(){
    return isCollapsing;
}

private boolean isMoving(){
    return isExpanding() || isCollapsing();
}

public void setOnExpandedListener(OnExpandedListener listener) {
    this.listener = listener;
}

public void removeOnExpandedListener(){
    this.listener = null;
}

public void setTitle(String title){
    if(textViewTitle != null) textViewTitle.setText(title);
}

public void setTitle(int resId){
    if(textViewTitle != null) textViewTitle.setText(resId);
}

public void setIcon(Drawable drawable){
    if(headerIcon != null){
        headerIcon.setBackground(drawable);
        iconDrawable = drawable;
    }
}

public void setIcon(int resId){
    if(headerIcon != null){
        iconDrawable = ContextCompat.getDrawable(getContext(), resId);
        headerIcon.setBackground(iconDrawable);
    }
}

private void setInnerView(int resId){
    ViewStub stub = findViewById(R.id.viewStub);
    stub.setLayoutResource(resId);
    innerView = stub.inflate();
}

public View getInnerView(){
    return innerView;
}


@Override
public void setOnClickListener(@Nullable OnClickListener l) {
    if(arrowBtn != null) arrowBtn.setOnClickListener(l);
    super.setOnClickListener(l);
}

public long getAnimDuration() {
    return animDuration;
}

public void setAnimDuration(long animDuration) {
    this.animDuration = animDuration;
}

private OnClickListener defaultClickListener = new OnClickListener() {
    @Override
    public void onClick(View v) {
        if(isExpanded()) collapse();
        else expand();
    }
};

/**
 * Interfaces
 */
public interface OnExpandedListener {

    void onExpandChanged(View v, boolean isExpanded);

}

}
`
Its layout ->

`<com.google.android.material.card.MaterialCardView
android:id="@+id/card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/default_vertical_padding"
android:paddingBottom="@dimen/default_vertical_padding"
style="@style/Widget.MaterialComponents.CardView"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="12dp"
app:cardElevation="4dp"
app:cardCornerRadius="3dp"
app:strokeColor="@color/colorBlack"
app:strokeWidth="1.5dp">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/default_card_height"
        android:id="@+id/header">

        <ImageButton
            android:id="@+id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"/>

        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:text="Prova"
            android:padding="8dp"
            android:maxLines="1"
            android:layout_centerVertical="true"
            android:textColor="@android:color/primary_text_light" />

        <ImageButton
            android:id="@+id/arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:padding="8dp"
            android:background="?selectableItemBackgroundBorderless"
            android:src="@drawable/ic_arrow_down"/>

    </RelativeLayout>

    <ViewStub
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/viewStub"
        android:inflatedId="@+id/innerView"/>


</LinearLayout>

</com.google.android.material.card.MaterialCardView>`

My fragment layout ->

`
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".views.OrdersPlacedFragment"
android:background="@color/colorWhite">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

            <com.busisoft.ezeeoffice.helpers.ExpandableCardViewHelper
        android:id="@+id/frag_order_placed_status_wise_order"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:title="Orders Status wise"
        app:inner_view="@layout/chart_area"
        app:expandOnClick="true" />

    

</LinearLayout>

</androidx.core.widget.NestedScrollView>`

My HighChart view ->

`
<com.highsoft.highcharts.Core.HIChartView
android:id="@+id/hc"
android:layout_width="match_parent"
android:layout_height="300dp"
xmlns:android="http://schemas.android.com/apk/res/android" >

<ImageButton
    android:id="@+id/infoBtn"
    android:layout_alignParentTop="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_marginEnd="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginTop="20dp"
    android:background="@null"
    android:src="@drawable/ic_info_outline_white_24dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

</com.highsoft.highcharts.Core.HIChartView>
`

HighCharts setEvents

Hi
I am loading a pie chart with values and set a click event on it.When i click on it another chart of type area loads with some values by calling reload().The next case is that when i click on area chart I have to load another chart with some data which is similar to drilldown. The issue i face here is when I click on area chart I cannot handle the click event.It's showing some error like this

E/libHC: Uncaught ReferenceError: Android4 is not defined

I am facing this issue whenever i reload the another chart with some values(chart reloading is fine but can't handle the click event).

Can you please help me regarding the above issue!

Thanks in advance!!

graph not refreshing after calling it again on Activity.

I am hitting API when response comes then calling method which contains Graph Code, First time its works perfect but when i again hit API different Data is coming with title but graph remains as it is.

I am using https://www.highcharts.com/android/demo/line-basic

Below is the code :


private void JsonRequestOrderVelocity(String dmhw) {

............. Json Response

     if(dmhw.equalsIgnoreCase("day")){
                            callGraphView("Daily");
                        }else if(dmhw.equalsIgnoreCase("hour")){
                            callGraphView("Hourly");
                        }else if(dmhw.equalsIgnoreCase("minute")){
                            callGraphView("Minute-wise");
                        }else{
                            callGraphView("Weekly");
                        }

                       ....................
}




private void callGraphView(String timeType) {
        Log.e("TIMETYPE",""+timeType);
        chartView.setWillNotDraw(false);
        HIOptions options = new HIOptions();

        HIChart chart = new HIChart();
        chart.type = "line";
        options.chart = chart;

        HITitle title = new HITitle();
        title.text = "("+getIntent().getStringExtra("WHARE_HOUSE_NAME")+") "+timeType+" Sales Trend";
        options.title = title;

        HISubtitle subtitle = new HISubtitle();
        subtitle.text = "Source: thesolarfoundation.com";
        options.subtitle = subtitle;

        HIYAxis yaxis = new HIYAxis();
        yaxis.title = new HITitle();
        yaxis.title.text = "Quantity Sold";
        options.yAxis = new ArrayList<>(Collections.singletonList(yaxis));

        HIXAxis xaxis = new HIXAxis();
        xaxis.categories=orderVelocityPojo.getRange();
        options.xAxis = new ArrayList<>(Collections.singletonList(xaxis));

        HILegend legend = new HILegend();
        legend.layout = "vertical";
        legend.align = "right";
        legend.verticalAlign = "middle";
        options.legend = legend;
       ..............
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.