amcharts - Adding ticks between categories - amcharts4

I would like to add ticks between categories on the category axis to separate them, as highlighted in the picture below.
Can anyone point me in the right direction?

I found the answer in a tutorial here
categoryAxis.renderer.ticks.template.location = 0;

Related

SUM VALUES FROM 2 DISTINCT COLUMNS

Hello, people.
As you guys can see on the table above, I´have more than one "seller" per "order_num" and it’s ok. But I need to SUM the "sku_qtd" without repeating the items from the order. Right now, SUM is returning 6 instead of 3.
Pls help me, I have been looking for an answer for hours.
If you cannot modify the data model to properly represent the relationship between order_num and seller (many-to-one or many-to-many), this DAX formula should do it:
sum_qtd = SUMX(DISTINCT('table'[order_num]),FIRSTNONBLANK('table'[sku_qtd],0))

Get products according to chosen value

I am creating a shop with Opencart 1.5.6 & I'm new to opencart & php so please help me
I searched a lot but all of results are talking about adding a filter in SORT drop down list like manufacturer ..
but I don't want to sort,
I added a new custom field called COLOR to product and i want to create a new drop down list contains RED,BLUE,& BLACK options and it will get all the products with this chosen color.
I tried to create a drop down list like "Sort By:" one,
but i can't because i have no experience with PHP or Opencart.
PLEASE HELP ME !! and thanks in advance :)
As you said you are beginner so just go through step by step
In Opencart there is a feature called filter which exactly fulfills your requirement
**Step1 (Creating Filter)**
Admin panel>catalog>filter>Inset a new filter
->Filter Group Name "Color".
->click on add filter and add your colors "Red, Green, Blue...."
**Step2 (Adding Filter attribute to Product)**
Admin panel>catalog>products>edit product
->under the link tab there is a filter add the filter to product you want
eg if the product is red in color add "red"
->Do this to all product you wanted to be filtered.
**Step3 (Adding Filter Scope to category)**
Admin panel>catalog>categories>edit category
->under the data tab there is a filter add the filter you want to be displayed like "red, green etc.."
->Do this to all category you wanted filter to be displayed.
**Step4 (Enable Filter module or setting layout)**
Admin panel>Extensions>Modules
->Find Filter and click on install
->Now Edit the filter
->click on add module
->Set Layout to Category, Position to Content Top and Status to Enable
->Click on Save
Now you are done, In category you can see the filter feature in category,
If you still find difficulties you can follow the official documentation http://docs.opencart.com/display/opencart/Filters
Hope this helps.

Merit Gem: how to grab a User's points for a single day?

How can I grab a User's points for a single day (i.e. 'Today' or 'Yesterday') using the Merit gem?
I tried:
current_user.points.where("created_at >= ?", Time.zone.now.beginning_of_day)
but that doesn't work.
There's a models diagram for merit in https://github.com/tute/merit/wiki/General-merit-workflow. With that in mind, lines like this makes it work:
user = User.first
points = user.sash.scores.first.score_points
points.where("created_at > '#{Time.zone.now.beginning_of_day}'")
This is the final answer:
u.sash.scores.first.score_points.where("created_at > ?", Time.zone.now.beginning_of_day).sum(:num_points)
Thanks TuteC.

django queryset with count filter

I've done the entire Django Tutorial, but I couldn't figure out how to make the website display only Polls with Choices count bigger than 0.
I know that Poll.objects.get(pk=1).choice_set.count() would return the number of choices I have.
So I tried the filter Poll.objects.filter(choice_set.count()>0) and it didn't work.
Can someone help me please? Thanks
This is my actual queryset.
queryset=Poll.objects.filter(pub_date__lte=timezone.now).order_by('-pub_date')[:5]
queryset=Poll.objects.annotate(count=Count('choice')).filter(
pub_date__lte=timezone.now, count__gt=0).order_by('-pub_date')[:5]

Django Distance Search by Zipcode

I want to search based on distance from inputted US zipcode.
First, I know I need a search form:
class SearchForm(forms.Form):
zipcode = forms.CharField(max_length=5)
Then I pass those options to next view where I filter based on inputted parameters. This is where it gets tricky for me.. I have searched around a lot and it seems there are many solutions to this. I have used this post as a reference would give me something like this:
def display_map(request, zipcode):
objects_near_zip = Thing.objects.filter(location__distance_lte=(Point([zipcode]), D(mi=5)))
But I need to turn the zipcode into a point. How would I do this? Is there a better solution that you have used? Thanks for your ideas!
EDIT:
I found this discussion, but the implementation is a little hard for me to understand. I create a Zipcode model, that makes sense.
But Im not sure how or where to load the zipcodes like he says in the post:
lm = LayerMapping(Zipcode, 'tl_2008_us_zcta5.shp',
{ 'code' : 'ZCTA5CE',
'mpoly' : 'MULTIPOLYGON',
})
lm.save()
Where do I place this code? The shp file is quite large and took a long time even on my desktop, so Im not sure this is the best solution.