Highsoft Highcharts not visible inside asp.net mvc partial viewASP.NET MVC controller actions that return JSON or partial htmlCompile Views in ASP.NET MVCHow do you create a dropdownlist from an enum in ASP.NET MVC?How do you handle multiple submit buttons in ASP.NET MVC Framework?How to render an ASP.NET MVC view as a string?ASP.NET MVC - Set custom IIdentity or IPrincipalASP.NET MVC View Engine ComparisonRender Partial View Using jQuery in ASP.NET MVCFile Upload ASP.NET MVC 3.0HighCharts: How to toggle yAxis options on browser resize?
What are ATC-side procedures to handle a jammed frequency?
Comma Code - Automate the Boring Stuff with Python
A file manager to open a zip file like opening a folder, instead of extract it by using a archive manager
I am 15 years old and do not go to a Yeshiva but would like to learn Talmud. A few rabbis near me said they could teach me. How should I start
What is the meaning of word 'crack' in chapter 33 of A Game of Thrones?
Examples of "unsuccessful" theories with afterlives
Why are there two fundamental laws of logic?
Excel Solver linear programming - Is it possible to use average of values as a constraint without #DIV/0! errors or sacrificing linearity?
Can my former employer sue me if I don't give them the photos I took (taking pictures was not part of my job description)?
practicality of 30 year fix mortgage at 55 years of age
How to justify a team increase when the team is doing well?
Does wetting a beer glass change the foam characteristics?
Why does (inf + 0j)*1 evaluate to inf + nanj?
OSM Thunderforest API keys in QGIS3
Designing a time thief proof safe
Best way to visualize huge amount of data
Is it a good idea to leave minor world details to the reader's imagination?
What would influence an alien race to map their planet in a way other than the traditional map of the Earth
What should I consider when deciding whether to delay an exam?
Golf (6-card) Golf!
I nicked the tip of the taper on a bottom bracket spindle. Is it still safe?
Symbol for function composition like a big sum
Suffocation while cooking under an umbrella?
Subverting the emotional woman and stoic man trope
Highsoft Highcharts not visible inside asp.net mvc partial view
ASP.NET MVC controller actions that return JSON or partial htmlCompile Views in ASP.NET MVCHow do you create a dropdownlist from an enum in ASP.NET MVC?How do you handle multiple submit buttons in ASP.NET MVC Framework?How to render an ASP.NET MVC view as a string?ASP.NET MVC - Set custom IIdentity or IPrincipalASP.NET MVC View Engine ComparisonRender Partial View Using jQuery in ASP.NET MVCFile Upload ASP.NET MVC 3.0HighCharts: How to toggle yAxis options on browser resize?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I try to render a highsoft highchart inside a partial view.
If I render the chart on a main view, everthing works fine.
The partial view will be loaded via an ajax call inside my main view "index.cshtml":
@
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
<button id="showIndexChart" onclick="RenderIndexPartial()">Get Partial</button>
<div id="PartialContent">
</div>
@section scripts
<script>
var RenderIndexPartial = function ()
$.ajax(
url: '/Line/RenderIndexPartial',
type: "Get",
cache: false,
dataType: "html",
success: function (PartialViewData)
$('#PartialContent').html(PartialViewData);
,
error: function (xhr, status, error)
console.log("status: " + status + " / error: " + error);
,
);
;
</script>
The controller action for the partial view looks like this:
It returns the partial view and a model (object Highsoft.Web.Mvc.Charts.Highcharts)
[HttpGet]
public ActionResult RenderPartial()
List<double> tokyoValues = new List<double> 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6 ;
List<LineSeriesData> tokyoData = new List<LineSeriesData>();
tokyoValues.ForEach(p => tokyoData.Add(new LineSeriesData Y = p ));
var tmpChart = new Highcharts()
Chart = new Chart
Height = 100,
Width = 100,
Type = ChartType.Line,
RenderTo = "containerPartial",
,
Title = new Title
Text = "Monthly Average Temperature",
,
XAxis = new List<XAxis>
new XAxis
Categories = new List<string> "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ,
,
YAxis = new List<YAxis>
new YAxis
Title = new YAxisTitle
Text = "Temperature (°C)"
,
PlotLines = new List<YAxisPlotLines>
new YAxisPlotLines
Value = 0,
Width = 1,
Color = "#808080"
,
Series = new List<Series>
new LineSeries
Name = "Tokyo",
Data = tokyoData,
,
;
return PartialView("_Index", tmpChart);
The partial view "_index.cshtml" is here:
@model Highsoft.Web.Mvc.Charts.Highcharts
@using Highsoft.Web.Mvc.Charts
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
@(Html.Highsoft().Highcharts(Model, "ChartB")
</div>
If I check the dom elements there is somthing missing inside the highcharts div
Can maybe someone help me? Thank you so much.
Update:
The div content an my main view where the chart is visible looks a little bit dirrent:
And thats the response from my ajax call what shoul load to the div "PartialContent":
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
<div id='ChartB' style='height:100;min-width:100;clear:both;margin: 0 auto;'></div><script type='text/javascript'>if (document.addEventListener) document.addEventListener("DOMContentLoaded", function() createChartChartB();); else if (document.attachEvent) document.attachEvent("onreadystatechange", function()if (document.readyState === "complete")document.detachEvent("onreadystatechange", arguments.callee);createChartChartB(););function createChartChartB() var ChartOptions = "xAxis":["categories":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]],"chart":"height":100,"width":100,"type":"line","renderTo":"ChartB","title":"text":"Monthly Average Temperature","series":["name":"Tokyo","type":"line","data":["y":7,"y":6.9,"y":9.5,"y":14.5,"y":18.2,"y":21.5,"y":25.2,"y":26.5,"y":23.3,"y":18.3,"y":13.9,"y":9.6]],"yAxis":["title":"text":"Temperature (°C)","plotLines":["width":1,"color":"#808080","value":0]];new Highcharts.chart("ChartB",ChartOptions);</script>
</div>
ajax asp.net-mvc highcharts
|
show 2 more comments
I try to render a highsoft highchart inside a partial view.
If I render the chart on a main view, everthing works fine.
The partial view will be loaded via an ajax call inside my main view "index.cshtml":
@
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
<button id="showIndexChart" onclick="RenderIndexPartial()">Get Partial</button>
<div id="PartialContent">
</div>
@section scripts
<script>
var RenderIndexPartial = function ()
$.ajax(
url: '/Line/RenderIndexPartial',
type: "Get",
cache: false,
dataType: "html",
success: function (PartialViewData)
$('#PartialContent').html(PartialViewData);
,
error: function (xhr, status, error)
console.log("status: " + status + " / error: " + error);
,
);
;
</script>
The controller action for the partial view looks like this:
It returns the partial view and a model (object Highsoft.Web.Mvc.Charts.Highcharts)
[HttpGet]
public ActionResult RenderPartial()
List<double> tokyoValues = new List<double> 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6 ;
List<LineSeriesData> tokyoData = new List<LineSeriesData>();
tokyoValues.ForEach(p => tokyoData.Add(new LineSeriesData Y = p ));
var tmpChart = new Highcharts()
Chart = new Chart
Height = 100,
Width = 100,
Type = ChartType.Line,
RenderTo = "containerPartial",
,
Title = new Title
Text = "Monthly Average Temperature",
,
XAxis = new List<XAxis>
new XAxis
Categories = new List<string> "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ,
,
YAxis = new List<YAxis>
new YAxis
Title = new YAxisTitle
Text = "Temperature (°C)"
,
PlotLines = new List<YAxisPlotLines>
new YAxisPlotLines
Value = 0,
Width = 1,
Color = "#808080"
,
Series = new List<Series>
new LineSeries
Name = "Tokyo",
Data = tokyoData,
,
;
return PartialView("_Index", tmpChart);
The partial view "_index.cshtml" is here:
@model Highsoft.Web.Mvc.Charts.Highcharts
@using Highsoft.Web.Mvc.Charts
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
@(Html.Highsoft().Highcharts(Model, "ChartB")
</div>
If I check the dom elements there is somthing missing inside the highcharts div
Can maybe someone help me? Thank you so much.
Update:
The div content an my main view where the chart is visible looks a little bit dirrent:
And thats the response from my ajax call what shoul load to the div "PartialContent":
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
<div id='ChartB' style='height:100;min-width:100;clear:both;margin: 0 auto;'></div><script type='text/javascript'>if (document.addEventListener) document.addEventListener("DOMContentLoaded", function() createChartChartB();); else if (document.attachEvent) document.attachEvent("onreadystatechange", function()if (document.readyState === "complete")document.detachEvent("onreadystatechange", arguments.callee);createChartChartB(););function createChartChartB() var ChartOptions = "xAxis":["categories":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]],"chart":"height":100,"width":100,"type":"line","renderTo":"ChartB","title":"text":"Monthly Average Temperature","series":["name":"Tokyo","type":"line","data":["y":7,"y":6.9,"y":9.5,"y":14.5,"y":18.2,"y":21.5,"y":25.2,"y":26.5,"y":23.3,"y":18.3,"y":13.9,"y":9.6]],"yAxis":["title":"text":"Temperature (°C)","plotLines":["width":1,"color":"#808080","value":0]];new Highcharts.chart("ChartB",ChartOptions);</script>
</div>
ajax asp.net-mvc highcharts
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting someconsole.log
?
– ppotaczek
Mar 29 at 8:45
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
Hi @Osti, All these elements in the chart container are created bychart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to callcreateChartChartB()
without if - else statemants.
– ppotaczek
Mar 29 at 10:46
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
Sorry, but I do not knowASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously andDOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq
– ppotaczek
Mar 29 at 11:12
|
show 2 more comments
I try to render a highsoft highchart inside a partial view.
If I render the chart on a main view, everthing works fine.
The partial view will be loaded via an ajax call inside my main view "index.cshtml":
@
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
<button id="showIndexChart" onclick="RenderIndexPartial()">Get Partial</button>
<div id="PartialContent">
</div>
@section scripts
<script>
var RenderIndexPartial = function ()
$.ajax(
url: '/Line/RenderIndexPartial',
type: "Get",
cache: false,
dataType: "html",
success: function (PartialViewData)
$('#PartialContent').html(PartialViewData);
,
error: function (xhr, status, error)
console.log("status: " + status + " / error: " + error);
,
);
;
</script>
The controller action for the partial view looks like this:
It returns the partial view and a model (object Highsoft.Web.Mvc.Charts.Highcharts)
[HttpGet]
public ActionResult RenderPartial()
List<double> tokyoValues = new List<double> 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6 ;
List<LineSeriesData> tokyoData = new List<LineSeriesData>();
tokyoValues.ForEach(p => tokyoData.Add(new LineSeriesData Y = p ));
var tmpChart = new Highcharts()
Chart = new Chart
Height = 100,
Width = 100,
Type = ChartType.Line,
RenderTo = "containerPartial",
,
Title = new Title
Text = "Monthly Average Temperature",
,
XAxis = new List<XAxis>
new XAxis
Categories = new List<string> "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ,
,
YAxis = new List<YAxis>
new YAxis
Title = new YAxisTitle
Text = "Temperature (°C)"
,
PlotLines = new List<YAxisPlotLines>
new YAxisPlotLines
Value = 0,
Width = 1,
Color = "#808080"
,
Series = new List<Series>
new LineSeries
Name = "Tokyo",
Data = tokyoData,
,
;
return PartialView("_Index", tmpChart);
The partial view "_index.cshtml" is here:
@model Highsoft.Web.Mvc.Charts.Highcharts
@using Highsoft.Web.Mvc.Charts
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
@(Html.Highsoft().Highcharts(Model, "ChartB")
</div>
If I check the dom elements there is somthing missing inside the highcharts div
Can maybe someone help me? Thank you so much.
Update:
The div content an my main view where the chart is visible looks a little bit dirrent:
And thats the response from my ajax call what shoul load to the div "PartialContent":
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
<div id='ChartB' style='height:100;min-width:100;clear:both;margin: 0 auto;'></div><script type='text/javascript'>if (document.addEventListener) document.addEventListener("DOMContentLoaded", function() createChartChartB();); else if (document.attachEvent) document.attachEvent("onreadystatechange", function()if (document.readyState === "complete")document.detachEvent("onreadystatechange", arguments.callee);createChartChartB(););function createChartChartB() var ChartOptions = "xAxis":["categories":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]],"chart":"height":100,"width":100,"type":"line","renderTo":"ChartB","title":"text":"Monthly Average Temperature","series":["name":"Tokyo","type":"line","data":["y":7,"y":6.9,"y":9.5,"y":14.5,"y":18.2,"y":21.5,"y":25.2,"y":26.5,"y":23.3,"y":18.3,"y":13.9,"y":9.6]],"yAxis":["title":"text":"Temperature (°C)","plotLines":["width":1,"color":"#808080","value":0]];new Highcharts.chart("ChartB",ChartOptions);</script>
</div>
ajax asp.net-mvc highcharts
I try to render a highsoft highchart inside a partial view.
If I render the chart on a main view, everthing works fine.
The partial view will be loaded via an ajax call inside my main view "index.cshtml":
@
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
<button id="showIndexChart" onclick="RenderIndexPartial()">Get Partial</button>
<div id="PartialContent">
</div>
@section scripts
<script>
var RenderIndexPartial = function ()
$.ajax(
url: '/Line/RenderIndexPartial',
type: "Get",
cache: false,
dataType: "html",
success: function (PartialViewData)
$('#PartialContent').html(PartialViewData);
,
error: function (xhr, status, error)
console.log("status: " + status + " / error: " + error);
,
);
;
</script>
The controller action for the partial view looks like this:
It returns the partial view and a model (object Highsoft.Web.Mvc.Charts.Highcharts)
[HttpGet]
public ActionResult RenderPartial()
List<double> tokyoValues = new List<double> 7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6 ;
List<LineSeriesData> tokyoData = new List<LineSeriesData>();
tokyoValues.ForEach(p => tokyoData.Add(new LineSeriesData Y = p ));
var tmpChart = new Highcharts()
Chart = new Chart
Height = 100,
Width = 100,
Type = ChartType.Line,
RenderTo = "containerPartial",
,
Title = new Title
Text = "Monthly Average Temperature",
,
XAxis = new List<XAxis>
new XAxis
Categories = new List<string> "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ,
,
YAxis = new List<YAxis>
new YAxis
Title = new YAxisTitle
Text = "Temperature (°C)"
,
PlotLines = new List<YAxisPlotLines>
new YAxisPlotLines
Value = 0,
Width = 1,
Color = "#808080"
,
Series = new List<Series>
new LineSeries
Name = "Tokyo",
Data = tokyoData,
,
;
return PartialView("_Index", tmpChart);
The partial view "_index.cshtml" is here:
@model Highsoft.Web.Mvc.Charts.Highcharts
@using Highsoft.Web.Mvc.Charts
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
@(Html.Highsoft().Highcharts(Model, "ChartB")
</div>
If I check the dom elements there is somthing missing inside the highcharts div
Can maybe someone help me? Thank you so much.
Update:
The div content an my main view where the chart is visible looks a little bit dirrent:
And thats the response from my ajax call what shoul load to the div "PartialContent":
<h1>Partial loaded</h1>
<div id="containerPartial" style="height: 400px">
<div id='ChartB' style='height:100;min-width:100;clear:both;margin: 0 auto;'></div><script type='text/javascript'>if (document.addEventListener) document.addEventListener("DOMContentLoaded", function() createChartChartB();); else if (document.attachEvent) document.attachEvent("onreadystatechange", function()if (document.readyState === "complete")document.detachEvent("onreadystatechange", arguments.callee);createChartChartB(););function createChartChartB() var ChartOptions = "xAxis":["categories":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]],"chart":"height":100,"width":100,"type":"line","renderTo":"ChartB","title":"text":"Monthly Average Temperature","series":["name":"Tokyo","type":"line","data":["y":7,"y":6.9,"y":9.5,"y":14.5,"y":18.2,"y":21.5,"y":25.2,"y":26.5,"y":23.3,"y":18.3,"y":13.9,"y":9.6]],"yAxis":["title":"text":"Temperature (°C)","plotLines":["width":1,"color":"#808080","value":0]];new Highcharts.chart("ChartB",ChartOptions);</script>
</div>
ajax asp.net-mvc highcharts
ajax asp.net-mvc highcharts
edited Mar 29 at 9:25
Osti
asked Mar 28 at 17:32
OstiOsti
258 bronze badges
258 bronze badges
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting someconsole.log
?
– ppotaczek
Mar 29 at 8:45
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
Hi @Osti, All these elements in the chart container are created bychart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to callcreateChartChartB()
without if - else statemants.
– ppotaczek
Mar 29 at 10:46
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
Sorry, but I do not knowASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously andDOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq
– ppotaczek
Mar 29 at 11:12
|
show 2 more comments
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting someconsole.log
?
– ppotaczek
Mar 29 at 8:45
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
Hi @Osti, All these elements in the chart container are created bychart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to callcreateChartChartB()
without if - else statemants.
– ppotaczek
Mar 29 at 10:46
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
Sorry, but I do not knowASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously andDOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq
– ppotaczek
Mar 29 at 11:12
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting some
console.log
?– ppotaczek
Mar 29 at 8:45
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting some
console.log
?– ppotaczek
Mar 29 at 8:45
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
Hi @Osti, All these elements in the chart container are created by
chart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to call createChartChartB()
without if - else statemants.– ppotaczek
Mar 29 at 10:46
Hi @Osti, All these elements in the chart container are created by
chart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to call createChartChartB()
without if - else statemants.– ppotaczek
Mar 29 at 10:46
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
Sorry, but I do not know
ASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously and DOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq– ppotaczek
Mar 29 at 11:12
Sorry, but I do not know
ASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously and DOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq– ppotaczek
Mar 29 at 11:12
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403706%2fhighsoft-highcharts-not-visible-inside-asp-net-mvc-partial-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403706%2fhighsoft-highcharts-not-visible-inside-asp-net-mvc-partial-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hi @Osti, Any errors in the console? The generated JS code seems to look ok, but are you sure that the code is called? Could you check that, for example by inserting some
console.log
?– ppotaczek
Mar 29 at 8:45
I added another picture to my question and the consolge.log(PartialViewData)
– Osti
Mar 29 at 9:22
Hi @Osti, All these elements in the chart container are created by
chart
constructor function. Please check this example: jsfiddle.net/BlackLabel/kfv2dupt - your code works correctly. However, I think that the problem is caused by the events. Please try to callcreateChartChartB()
without if - else statemants.– ppotaczek
Mar 29 at 10:46
OK, but my whole chart will be created at the controller side and passed as model inside my partial view. How should I remove the "if else" statement?
– Osti
Mar 29 at 11:00
Sorry, but I do not know
ASP.NET
, I can help you only with JS code. It seems that your JS code is not called because it is loaded asynchronously andDOMContentLoaded
event was already called. Similar case: jsfiddle.net/BlackLabel/dozb7rgq– ppotaczek
Mar 29 at 11:12