ChartJS ignores 'chartOptions' - vue.js

I can't find out how to set the "chartOptions", neither with the help of the documentation (https://vue-chartjs.org/), nor other tools.
For this I built a simple sandbox environment on codesandbox.io, so you can have a closer look.
There you can find two bar charts in the folder "components". Both have a different approach and both ignore e.g. the "min" and "max" value when scaling the chart. Just like the chart title is ignored, too. In the meantime I don't know what I can or should do. In the meantime I have tried everything possible and I just can't find a solution.
I need to define the options externally, or at least be able to override them before rendering. The second option would be even much better!
I would be very happy if someone could help me.
https://codesandbox.io/s/vuejs-3-chartjs-zz5194?file=/src/App.vue

Related

Single feature highlight on hover

map.js :
https://github.com/ro-hit81/COVID-19-Vuetify/blob/master/src/assets/map.js
timeline.vue:
https://github.com/ro-hit81/COVID-19-Vuetify/blob/master/src/views/Timeline.vue
Actually it is going to be a confusing query I guess and it might get difficult for me to make my problem understandable. I am actually using 'Vue js' and 'Echarts js' to create a Map of my country with some temporal point data. The problem may be minor but I am not able to figure out to solve.
While importing China.json file in my .js file, I can see 'Province' is highlighted on hover as:
Now, without changing any code, only importing Nepal.json file inplace of China.json, I see whole layer is highlighted on hover.
I want single feature (as in 'Province' in case of China data , similarly 'District' in case of Nepal data) to be highlighted on hover.
I tried my best to make this problem understandable. Please tell me kindly if i have to attach code.

Gridster add_widget is slow

I want use Gridster for my web site, but i need to add lot of widgets with "add_widget" command. I do a test and i think there is a problem with "add_widget" function : grid is more and more slow and there are memory leak.
You can see that in this video : grister problem video
However, as you can see on the video, if i add widget at beginning (not with add_widget function) there is no problem. Can you help me ? Something wrong with my code ?
Thanks in advance !
In my own experience, the main culprit was using the autogenerate_stylesheet setting. The problem is that it regenerates the css on every call to add_widget(), and this just absolutely kills browsers. Additionally, gridster has/had a bug where stylesheets get duplicated, filling the <head> with tons of duplicate style rules, making it tough on the browser(this bug was supposedly fixed, but my experience was that the fix only worked in specific scenarios, definitely not in mine).
When I used gridster, my widgets were always the same size. So, in my case, I was able to generate the stylesheet once, never needing to regenerate it.
I don't think its part of the public api, but you can just call generate_stylesheet() method once manually.
var gridster = $(".gridster ul").gridster({
autogenerate_stylesheet: false,
widget_base_dimensions: [140, 140],
//other options...
}).data('gridster');
gridster.generate_stylesheet({rows: 30; cols: 8});
//freely call gridster.add_widget(...); as many times as you like
Since you're only going to generate the stylesheet once, you need to make sure gridster will generate style rules for enough rows and columns to accommodate all your widgets, otherwise once you exceed the range, you'll experience broken layouts. Just supply an upper bound on rows and cols when calling generate_stylesheet(opts). If you don't, it seems like it defaults to whatever value your gridster instance is using for max_rows and max_cols.
The nice thing is by manually generating the stylesheet, is that you completely avoid the duplicate style bug too.
The exponential slowdown will be gone. Happy gridstering.
I know I'm a bit late on this but I had the same problem and none of the above solutions worked.
However, I found that I was generating the size and coordinates of the widgets as a string rather than an integer on the back-end.
By making sure they were integers I managed to speed things up loads.
The best way to fix it, is not to disable the autogenerated stylesheet, but to edit the fn.generate_stylesheet function in jquery.gridster.js
At the end of the function, just before these lines:
return this.add_style_tag(styles);
};
add this line:
this.remove_style_tags();
The final result would look like this:
this.remove_style_tags();
return this.add_style_tag(styles);
};
With this, each time a stylesheet is generated, the previous one is removed, so there no duplication problem!

Summary of all IBOutlet, IBAction connections in a project?

Is there a tool or trick for displaying all the connections between objects in an Xcode project? I'm thinking of some kind of graphical display, or less desirably, a table. Naturally this would be very useful for troubleshooting or studying sample code. I tried searching in here (SO) but the terms appear in many questions and connections has another meaning. Thanks.
Following Rob Napier's suggestion, something like "ibtool --connections foo.xib" might help. See http://cocoapi.wordpress.com/2009/02/20/how-to-look-for-a-specific-bind/ for some grunt stuff that might help as well.
I am new to this, too, and coming from android side. I wonder if it's better in the long run to define all connections dynamically in the view controller as needed, if that can be done in all scenarios. At least you can see how everything is hooked up there in one place.
In IB, you can simply click on File's Owner instead of on individual elements and it will show all available IBOutlets and IBActions in the right sidebar and what they are connected to.

How to get localized timer label like UIDatePickerModeCountDownTimer?

I want to get localized timer labels on my developing application.
For example, "hour,hours" and "min" on en_US, "時間" and "分" on ja_JP, "ora,ore" and "min" on it_IT etc.
UIDatePickerCountDownTimer mode can display them, but there seems no method to access.
I studied NSDateFormatter,NSLocale,UIDatePicker,etc, but I couldn't find the solution.
Please help me...
The text of the "hour" and "min" labels on UIDatePicker is not accessible to developers. If you want to use that text in your own app in a different context, you'll have to provide it yourself.
Of course, if you feel like this is something the frameworks should provide, please file a bug requesting this enhancement.

Simulate "Slide to Unlock" in MobileSubstrate

There is a way to simulate the Slide To Unlock in the lockscreen? I've been looked for this in SBAwayController, but without any results :( Have anyone an idea?
I believe (if I understand your question correctly) you want to have the lockbar "unlock itself". For something like that you want to look into SBAwayView, not SBAwayController. In that class there are different methods that interact with the different lockbars. You will want to specifically look at the SBAwayLockBar which is a sublcass of TPBottomLockBar (defined in <TelephonyUI/TPBottomLockBar.h>)
You will have to poke around in the headers and see if there is any way to access the lockbar's Knob position.
Hope that helped at least a bit.