Coder Social home page Coder Social logo

dataloader's People

Contributors

martynasma avatar pauan avatar xorspark 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

Watchers

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

dataloader's Issues

Accept headers not set

I just ran into an issue where Firefox wouldn't load any json graphs whereas Chrome would. It seems that Firefox sets a very specific accept header

text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8

that sets other accepted formats whereas chrome sets it as / . The particular service I'm pulling data from can return xml or json depending on the accept headers and was choosing to return xml since the default header includes it.

It seems to me that a sensible default would be to set application/json or text/csv based on what is specified in the dataLoader section with the option to override the defaults through the use of the headers array which is what I used to fix this problem.

Also, the fact that you can specify the accept headers is not specified on this page
http://www.amcharts.com/tutorials/using-data-loader-plugin/

Allowing reload of a single dataSet

I think it'd be really useful to be able to call onload for only one of the dataSet indexes instead of reloading them all. Similar to #9.

Simply enhancing loadData to take an argument which only loads that index would be enough. The current problem with loadData is it reloads all remote sources.

A use case of this is if you have a dataSetSelector and large number of remote dataSets, onload automatically calls when the chart is rendered, this causes all of these URL's to be requested and their graphs to be rendered. To support a use case where these are only load on select or compare (using a the dataSetSelector listener) would allow for the remote sources to be requested on change and not all once.

Something like:

{
    dataSets: [
      {
        id: 1,
        dataLoader: {}
      },
      {
        id: 2,
        dataLoader: {}
      }
   ]
}

chart.dataSetSelector.addListener("dataSetSelected", function(event) {
  dataSet = event.dataSet

  if (dataSet.dataProvider.length)
    return;

  dataSet.dataLoader = {url: '/path/to/json/" + dataSet.id) }
  chart.dataLoader.loadData(dataSet.id); // Takes ID or dataSet index
  chart.validateData();
});

[TypeError] if include lang/en.js

If I'm added to html: <script type="text/javascript" src="/js/amcharts/plugins/dataloader/lang/en.js"></script>
Set graph option: "language" : "en"

And this give me error: Uncaught TypeError: Cannot set property 'en' of undefined

Chrome 41 linux

Real time data issue

Hi

I am working on amchart world map plugin. Our data load every 5 mins and we are using map.validateData(); .

But when its refresh the data its also reload the complete world map.

Let me know how can i refresh data without reloading map.

ZoomToindex not working on dataLoader

"listeners": [{ "event": "init", "method": function(e) { e.chart.zoomToIndex(e.chart.dataLoader.length - 70, e.chart.dataLoader.length - 1); } }],

The code above does not work on AmCharts Serial with dataLoader.
Can anyone help?

chart.dataLoader.loadData() seems dose not work.

Hi there,

I am using AmCharts 3.

I can not use chart.dataLoader.loadData().

I initialize the instance like following.
var charts = [];
charts[charts.length] = AmCharts.makeChart();

charts[0].dataLoader.loadData().

Is this wrong way to use?

Loading the chart via Ajax, causes DataLoader to run multiple times.

So I have a page that loads the page the chart displays on via Ajax, it works fine, the dataLoader does it's job, but I notice if I load another page after that with another dataLoader, it now adds another ajax call, so if I look at 5 different charts, by the time I look at the 5th chart it has 5 unique ajax requests being made by the dataLoader, is there something that can be done to fix this?

[Bug] Not show parse error msg

I give at data not json content, and after complete (after msg Loading data...) show me onlu empty graph without errors, msgs.
Not work error msg: Error parsing JSON file

Problem when loading remote data with stock charts

With data with a date format "YYYY-MM-DD" and no dateFormat set within periodSelector, I'm getting this error, although the graph renders as expected:
Uncaught TypeError: Cannot read property 'setDefaultPeriod' of undefined

Fiddle: http://jsfiddle.net/6g6tcbb1/1/

When the dateFormat is set, the graph size is shrunk and no longer visible: http://jsfiddle.net/6g6tcbb1/2/

I'm guessing the periodSelector isn't waiting until the data has been fully loaded but it's hard to dig through the minified amcharts files.

Lang File not working

try every possible way i could think of to load Lang Translation since there's no examples shown how to use it but none are working.

ZoomToindex and dataloader

I try to use Zoomtoindex for my charts.
I use dataloader with some json data.

I want to do something like this :
zoomToIndex(chart.daraLoader.length -90 , chart.daraLoader.length -1);

But it doesn't work ... how can I have the length of the json data loaded with dataloader ?

Thanks

Using multiple files to load data into chart

I have searched high and low for a solution and have found many people asking this question but no answer. I am trying to alter this example to work with external data: https://www.amcharts.com/kbase/making-stock-charts-period-selector-input-fields-read-only/

Is it possible to load data from multiple CSVs into an array and then apply each set to a chart dataset??
Thanks!

Something like this...

var dataSets = [];
var files = ['1.csv', '2.csv', '3.csv', '4.csv'];

	for(var fileid in files) {
		AmCharts.loadFile(fileid, {}, function(    response ) {

  			/**
   			* Parse CSV
   			*/
	 var data = AmCharts.parseCSV( response, {
   		"useColumnNames": true
 		} );
	 dataSets.push(data);
 });
}

.................................
(Not sure whether to use "dataLoader" or "dataProvider")
.................................

var chart = AmCharts.makeChart("chartdiv", {
type: "stock",
"theme": "none",
//"dataProvider": dataSets,

pathToImages: "https://www.amcharts.com/lib/3/images/",

dataSets: [{
title: "first data set",
fieldMappings: [{
fromField: "value",
toField: "value"
}, {
fromField: "rank",
toField: "rank"
}],
dataLoader: dataSets[0],
categoryField: "date"
},

{
  title: "second data set",
  fieldMappings: [{
    fromField: "value",
    toField: "value"
  }, {
    fromField: "rank",
    toField: "rank"
  }],
  dataLoader: dataSets[1],
  categoryField: "date"
},

{
  title: "third data set",
  fieldMappings: [{
    fromField: "value",
    toField: "value"
  }, {
    fromField: "rank",
    toField: "rank"
  }],
  dataLoader: dataSets[2],
  categoryField: "date"
},

{
  title: "fourth data set",
  fieldMappings: [{
    fromField: "value",
    toField: "value"
  }, {
    fromField: "rank",
    toField: "rank"
  }],
  dataLoader: dataSets[3],
  categoryField: "date"
}

],

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.