G
G
gotohell2017-07-17 08:51:28
Computers
gotohell, 2017-07-17 08:51:28

How to get data from data attribute?

Hello!

Making a chart on chartist.js

Trying to get coordinates from data:

<td><a data-labels="700, 1500, 1300, 1000, 220" data-series="2000, 1700, 1500, 1300, 1100, 1000, 800, 600, 500">ВР 80-75-2,2-В-0,37/2730</a></td>


Script:
var series = $(this).data('data-series');
var labels = $(this).data('data-labels');

new Chartist.Line('.chart', {
  labels: labels,
  series: [
  series
  ]
}, {
  fullWidth: true,
  chartPadding: {
  right: 40
  }

});


It does not work, the console is silent!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
iBird Rose, 2019-01-26
@Marsmaksimus

The power supply has not yet been decided here, I think 600-700W that would work at half strength and not make much noise, if there is some quality and inexpensive one in mind, write

Yes. the most optimal 600-700. and the smaller ones will not differ much in price. Of the popular - Corsair, Seasonic. From cheap and at the same time good - FSP I
agree with stratosmi - instead of your chosen asrock in the same price category (or a little more expensive), you can choose ASUS, GIGABYTE, MSI
PS Another personal IMHO - I would change the seagate barracuda to WD BLUE

S
stratosmi, 2019-01-25
@stratosmi

Asrock - guano. Despite the fact that you have sane money for other components, it’s not worth saving 3 kopecks on your mother.

F
FeNUMe, 2019-01-26
@FeNUMe

Since you are assembling a machine for games, 240GB ssdshki will not be enough - modern games now sometimes eat up 100GB each (for example, fresh Atlas), so if you don’t want to “juggle” games between ssd / hdd, then you should immediately think about a 480GB + model

N
Negwereth, 2017-07-17
@Negwereth

$(this).data("series");
Even I, a terrible jQuery hater, know this.

E
Eugene, 2017-07-17
@Eugeny1987

var series = $(this).attr('data-series');
var labels = $(this).attr('data-labels');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question