Kendo chart not resizing within Twitter Bootstrap - twitter-bootstrap-3

Please see here
When the browser is resized, the Google Map and the grid are correctly resized. I want the Google map to always take up 100% of the page height.
I want the grid to take 70% and the chart to take up the rest.
However, the chart is not being resized vertically. Its as if there is a hard coded height somewhere
This is not the same kind of problem that other people have had where the chart does not resize at all, because if you make the browser wider and narrower the chart does resize horizontally
I call the code below when the window is loaded and when the window is resized
$(window).resize(function() {
resizeGrid();
var chart = $("#kendoChart").data("kendoChart");
//to check the chart exist or not if exist then redraw it..
if (chart) {
chart.redraw();
}
});
Also when the window is loaded
$(document).ready(function() {
var chart = $("#kendoChart").data("kendoChart");
//to check the chart exist or not if exist then redraw it..
if (chart) {
chart.redraw();
}
}
I have tried changing the height of the associated CSS class to varying percentages and nothing changes the height of the chart
As you can see from the markup below, I have no hard coded height here
<div id="chartContainer" class="chartContainer" >
#(Html.Kendo().Chart<IMeterProfileData>()
.Name("kendoChart")
.PlotArea(plotArea =>
plotArea.Margin(0)
)
.Legend(legend => legend
.Visible(false)
)
.AutoBind(false)
.Series(series => { series.Column(model => model.Consumption, categoryExpression: model => model.PeriodDateTime).Name("Consumption"); })
.CategoryAxis(axis => axis
.Date()
.BaseUnit(ChartAxisBaseUnit.Minutes).BaseUnitStep(30)
.Labels(label => label.Step(48).Rotation(-90).Format("dd/MM/yyyy"))
.Axis.MajorGridLines.Visible = false
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
.Line(line => line.Visible(false))
.Title("Consumption kWh")
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N0}")
).ChartArea(area => area.Border(1, "#cdcdcd", ChartDashType.Solid)
) )
</div>
Has anyone ever come across this?
Paul

To quote the developers,
"The size of the Chart can be set initially either in the configuration or by specifying the size on the parent element. For example:
$("#chart").kendoChart({
chartArea: {
width: 200,
height: 200
},
....
If you wish to change the size dynamically, you should also repaint the Chart by using the refresh or redraw methods after the change."
I'm unsure whether this supports percentage heights, only trying will tell. You'll probably have to calculate the height in JS whenever the page size changes if you want a dynamic page that fits the window.

Related

gsap scrolltrigger: slide through sections but wait for animations within to end

Consider de following codepen:
https://codepen.io/Zimutes/pen/NWYXYqa
ScrollTrigger.create({
markers: {
startColor: "grey",
endColor: "grey"
},
trigger: section,
start: () => (x - 0.5) * innerHeight,
end: () => (x + 0.5) * innerHeight,
onToggle: (self) => self.isActive && setSection(section)
});
I need the "slides" section to change onscroll, being that those sections are absolute positioned. I obviously still have to work that out, since it's not working properly.
But more importantly, inside each section I need to have images rendered into a canvas, so that it creates an animation. "Slide 2" must come into viewport only after all the images of "Slide 1" are shown, the scroll animation reached the end.
I'm not really sure If I whould try this using timeline, or containerAnimation, or the best way to go with this. How to make the slide change trigger only after all the images of the previous section were shown?
Thanks fro your help.

How to make Chart JS responsive?

I am using Chart.js with Twitter Bootstrap template. The Charts are not sized correctly if I don't mention a height and width for Canvas. But if I specify width and height then the charts are not responsive. How can I solve this issue?
Chart.js has a property (responsive) that you can configure at the global or chart level via options that will make the chart responsive. See http://www.chartjs.org/docs/#getting-started-global-chart-configuration > responsive
// Boolean - whether or not the chart should be responsive and resize when the browser does.
responsive: true,
true makes it responsive. false (default) makes it non-responsive.
Example usage (only the relevant part, check out the CodePen for the full exam)
var ctx = $("#bar").get(0).getContext("2d");
var myChart = new Chart(ctx).Bar(barData, {
responsive: true
});
CodePen - http://codepen.io/anon/pen/bdrGVx
You might also want to check out the maintainAspectRatio option, if you want to maintain the ratio of width to height.

dojo splitter not resizing properly with dynamic content

I'm creating a seemingly simple dojo 1.8 web page which contains an app layout div containing a tab container and an alarm panel below the tab container. They are separated by a splitter so the user can select how much of the alarms or the tabcontainer they want to see.
Here's the example on jsfiddle:
http://jsfiddle.net/bfW7u/
For the purpose of the demo, there's a timer which grows the table in the alarm panel by an entry every 2 seconds.
The problem(s):
If one doesn't do anything and just lets the table grow, no scroll bar appears in the alarm panel.
If one moves the splitter without having resized the browser window first, the splitter handle ends up in a weird location.
Resizing the browser window makes it behave like I would expect it to begin with.
Questions:
Am I doing something wrong in the way I'm setting things up and that's causing this problem?
How can I catch the splitter has been moved event (name?)
How do I resize the splitter pane to an arbitrary height? I've tried using domStyle.set("alarmPanel", "height", 300) and this indeed sets the height property... but the pane does not resize!
Any help greatly appreciated!
I forked your jsFiddle and made some modifications to it: http://jsfiddle.net/phusick/f7qL6/
Get rid of overflow: hidden in html, body and explicitly set height of alarmPanel:
.claro .demoLayout .edgePanel {
height: 150px;
}
This tricky one. You have two options: to listen to splitter's drag and drop or to listen to ContentPane.resize method invocation. Both via dojo/aspect:
// Drag and Drop
var splitter = registry.byId("appLayout").getSplitter("bottom");
var moveHandle = null;
aspect.after(splitter, "_startDrag", function() {
moveHandle = aspect.after(splitter.domNode, "onmousemove", function() {
var coords = {
x: !splitter.horizontal ? splitter.domNode.style.left : 0,
y: splitter.horizontal ? splitter.domNode.style.top : 0
}
dom.byId("dndOutput").textContent = JSON.stringify(coords);
})
});
aspect.after(splitter, "_stopDrag", function() {
moveHandle && moveHandle.remove();
});
// ContentPane.resize()
aspect.after(registry.byId("alarmPanel"), "resize", function(duno, size) {
dom.byId("resizeOutput").textContent = JSON.stringify(size);
});
Call layout() method after changing the size:
registry.byId("alarmPanel").domNode.style.height = "200px";
registry.byId("appLayout").layout();

Titanium: Tab's icon image not working

I am trying to change icons of my tab group's tab, but it doesn't show the image.
For iOS
I've used below code:
var win1 = Titanium.UI.createWindow
({
url:'Tab1.js'
});
var tab1 = Titanium.UI.createTab
({
icon:'footer_contactus_hover.png',
window:win1
});
// create controls tab and root window
var win2 = Titanium.UI.createWindow
({
url:'Tab2.js'
});
var tab2 = Titanium.UI.createTab
({
icon:'footer_search.png',
window:win2
});
I am having 4 tabs. Image's size is 81x51 . It shows me only blue rectangle instead of original image.
Also I've tried <property name="ti.android.fastdev" type="bool">false</property>
Whats wrong with the code ?
Assuming that your image does exist at the locations specified my first guess would be that your images are not created properly so that when the get masked all you see is a blue rectangle. I would suggest grabbing some other icon images from http://glyphish.com/ to see if it may be that your images are not created properly (I do not have any affiliation with that except I have used their icons in my projects and they are top-notch).
Also you may want to check out the Human Interface Guidelines as it sets forth specified sizes.
Solved by making images Transparent.
Also found : - Icon needs to be fileld with a color for visible pixels and transparent for the invisible part. The os will apply the blue glowing stuff, so if icon does not have transparent pixels you will only see a rectangle.

Sencha Touch Chart: Scroll bars with in chart panel and setting bar width

I am working on a mobile application and using sencha touch charts. By default horizontal bar chart is fitting exactly into screen. If there are more number of bars,then bars are appearing very thin and looking odd. I want to fix bar width to have uniform look and feel irrespective of number of bars being displayed. No matter even user need to scroll down to see entire chart. I have tried below option in series configuration, but it did not work.
style : {
size : 30
}
Please help me.
Thanks,
Nag.
am able to change the bar width by setting barWidth option in touchcharts-debug.js by refering to the following link
http://docs.sencha.com/touch-charts/1-0/source/Bar.html
but the axis labels are not rendering properly labels are fitting into screen
I tried this code in my interactions to render the labels, it's working fine
{
type: 'panzoom',
showOverflowArrows: false,
//axes: ['bottom'],
axes: {
bottom: false,
left: {
startZoom: 2
}
}
}