Closed (fixed)
Project:
Yandex.Metrics
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Feb 2013 at 13:20 UTC
Updated:
2 Apr 2013 at 17:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
Niremizov commentedHere is a patch, but it is without smoothing for now.
Comment #2
Niremizov commentedLine endings converted to the UNIX format.
Comment #3
Niremizov commentedAnd again line ending fix.
Comment #4
Niremizov commented!@#$%!
Comment #5
Konstantin Komelin commentedCommited: http://drupalcode.org/project/yandex_metrics.git/commit/2c79f1a
Comment #6
Niremizov commentedAttached patch, fixes "Views, Visitors and new Visitors" chart when using "one day" filter. Results are shown as horizontal lines.
Comment #7
Konstantin Komelin commentedСпасибо. Вот несколько моментов:
1) sizeof - это альяс на count . Давайте юзать count?
2) На комментарии тоже есть стандарты в Drupal http://drupal.org/coding-standards/docs
Например, на конце строки знак препинания, начало предложения с заглавной буквы и т.д.
Comment #8
Niremizov commentedHere it is, with coding-standards fixes...
PS: Still using sizeof, because you have said that it is used inside Drupal core.
Comment #9
kalabroMinor issues:
+ //If there is only one date point, we schould add it's dublicate forsmall typo: should, duplicate
+ } else {new line after first } http://drupal.org/coding-standards (Control Structures)
Thanks!
Comment #10
Konstantin Komelin commentedЕще пробел после //
Comment #11
Niremizov commentedThx for your patience... Okay, so comments have been checked by Coder and fixed. I suppose, it should be fine now.
Comment #12
Konstantin Komelin commentedThere was a bug in #11:
+ $new_visitors[] = !empty($z_point->new_visitors) ? $value->new_visitors : 0;I've replaced $value with $z_point and commited:
http://drupalcode.org/project/yandex_metrics.git/commit/cb5f32d
Let's think about grid lines for this chart.
See example http://code.google.com/p/drupal-chart-api/wiki/Examples (Grid lines and chart fill)
Is it possible to implement dashed grid through Chart module?
Comment #13
Konstantin Komelin commentedPorted to 6.x-2.x.
http://drupalcode.org/project/yandex_metrics.git/commit/c381f04
Comment #14
kalabrotagging
Comment #15
kalabroAdded smart grid.
Can be scaled.
~350 max value on 100px chart.

~30 max value on 250px chart.

Comment #16
Konstantin Komelin commentedTested. Looks beautiful!
Can we refactor chart method a bit because it's too long? For example, extract grid param calculation to separate function, smth like:
It's just automatic refactoring suggestion of my IDE and there are ways to improve it.
Anyway, it's great job. Thanks!
Comment #17
kalabroCommited and pushed!
http://drupalcode.org/project/yandex_metrics.git/commit/9350bf
Two helper methods (may be useful for other charts in future):
_yandex_metrics_reports_calculate_grid_fixed()for known number of grid lines._yandex_metrics_reports_calculate_grid_integerfor dynamic integer grids.Comment #18
Konstantin Komelin commentedWhat do you think about renaming of helper functions? See patch.
Comment #19
kalabroI personally dislike "static" because it is related for me to "static" PHP keyword.
Can we add @todo comment about these helter functions? I want to draw the attention of developers that with functions are open for further improvement in another use cases.
Comment #20
Konstantin Komelin commentedI spent some time to understand the purpose of the functions and then I only decided to rename because it was difficult to understand.
To improve @todo we will have to spend time to understand that again. So let's build good basis (architecture of code) now and improve algorithms later.
I also thought about the misunderstanding of 'static' but it's antonym for 'dynamic'.
So we can use 'fixed' istead of 'static' and 'fluid' or 'flexible' instead of 'dynamic'.
You know, I can improve it by myself without problems but It's important for me to know your opinion and explain mine.
Comment #21
kalabroLooks good.
Comment #22
Konstantin Komelin commentedOkay, let's use 'fixed' and 'fluid' ) Can I commit it?
Thanks.
Comment #23
kalabroSure!
Я не у штурвала :)
Comment #24
Konstantin Komelin commentedДан ;)
http://drupalcode.org/project/yandex_metrics.git/commit/eb5e460
Comment #25
Konstantin Komelin commented