AnsweredAssumed Answered

Displaying a line chart along with text fields inside a popUpTemplate.

Question asked by kishan2695 on Dec 12, 2017

I am building a sample web-mapping application using the ESRI 4.5 API. I have a single marker with a popUp on it. When an user clicks on the pop-up I want some text fields along with a line chart inside the popUp template. Right now, I am able to do both individually but I am not finding a way to display both of them together.

 

 

var c = dojo.create("div", {
id: "demoChart"
}, dojo.create('div'));

var chart = new dojox.charting.Chart2D(c);
chart.addPlot("default");
chart.addSeries("Series A", tagValues);
chart.addAxis("y", {
vertical: true,
fixLower: "major",
fixUpper: "major",
title: "Temperature",
min: 0
})
chart.addAxis("x", {
fixLower: "major",
fixUpper: "major"

});


var lineAtt = {
Name: "Keystone Pipeline",
Owner: "TransCanada",
Length: "3,456 km"
};


// Create a graphic and add the geometry and symbol to it
var pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol,
attributes: lineAtt,
popupTemplate: { // autocasts as new PopupTemplate()
title: "{Name}",

//How do I change the line below to include both the text fields and the chart
content: c
}
});

view.graphics.add(pointGraphic);
chart.render();

Outcomes