How to use Charting

Hi,

I’ve been trying out Fuse today and I’ve been very impressed with it. Just trying to get charts to work but I’m getting an error after following the guide.

I ran uno install Fuse.Charting and with the below code I get this error:
Could not resolve type c:Plot and c:DataSeries

<Panel ux:Class="Chart" xmlns:c="Fuse.Charting">
	<c:Plot>
		<c:DataSeries Data="{data}"/>
	</c:Plot>
</Panel>

Amy I missing something?

Thanks,

Ruairi

Hi Ruairi,

as the docs state, you need to include the Fuse.Charting package in your .unoproj file, under "Includes" section.

After that, rebuild the project and you should be good to go. Hope this helps!

That worked nicely, thanks for the quick reply. Now I’m getting an error: {name} not found in data context.

Is there any examples of the charts in use I could take a look at? Could find any in the examples section.

My code is below, tried different variations using just y, using value, excluding label. Always get the same error so maybe I’m using Observable incorrectly.

var Observable = require("FuseJS/Observable");
var data = Observable();

data.add({x:0, y:1, label: 'Test'});

module.exports = {
	data: data
};

Thanks,

Ruairi

If it complained about {name} not being found, then you probably didn’t export that variable (or have it in the objects). No way to tell from JavaScript only, since it was your UX that caused the notice to be thrown.

As for samples, there’s something coming in this pull request.

Perfect thanks, I’ll hold out for the example.

edit: moved the question to a new thread