Commit Graph

787 Commits (5d99034e246b939cc6170eec2fc2c5a05be391c7)
 

Author SHA1 Message Date
David Schnur ccb37e4965 Added missing credit line. 13 years ago
David Schnur 410dd7dbef Merge pull request #953 from dnschnur/jquery-chainable
Added the plot function as a chainable property.
13 years ago
David Schnur a787fa4e9c Updated credits for #953 chainable property. 13 years ago
David Schnur 1cb170df6e Updated credits for #895 threshold rounding fix. 13 years ago
David Schnur 06b201934c Updated credits for #534 pie string data fix. 13 years ago
David Schnur a6ce78d156 Remove unnecessary debugging code.
Modern browser consoles obviate the need for an object logging function.
13 years ago
David Schnur e491dc7a06 Cache the data value, since it is used repeatedly. 13 years ago
David Schnur d3a6bc965f Remove unnecessary numeric value checks.
The previous processing step already guarantees that the values are
numeric.
13 years ago
David Schnur 2a189b2cfb Improve the data value fix-up step.
This resolves #534 by handling the case where data is a string, whether
it is provided alone or as a pair.  We can also eliminate the old and
unnecessary check for undefined values.
13 years ago
David Schnur aaa1cc7f84 Document the new plot chainable property. 13 years ago
David Schnur 49cce02be9 Add the plot function as a chainable property.
Resolves #734 and #816.
13 years ago
David Schnur 78f2dfdf09 Updated credits for #937 lineWidth work-around. 13 years ago
David Schnur ad823de836 Merge pull request #937 from jamiehs/issue-842-cherry-pick
Fix inability to set the point lineWidth to 0.
13 years ago
David Schnur 9108c292c7 Avoid rounding errors with intersection points.
This resolves #895.
13 years ago
David Schnur 73e7dd7da8 Updated credits for pie setData fix. 13 years ago
David Schnur ef73cf7ec1 Set processed back to false after processing.
This temporary fix addresses the problem described in #810, and possibly
#945, where calls to setData for a pie chart do nothing.
13 years ago
David Schnur 7317b9c632 Remove the non-existent second 'data' parameter. 13 years ago
David Schnur 9ede692e2f Removed the unused plugin-global raw variable. 13 years ago
David Schnur 55864254d2 Removed unnecessary plugin-global variables.
The canvasWidth, canvasHeight, legendWidth and legendHeight variables
existed only to share data between the setupPie and draw functions.  Now
that setupPie has been folded into draw, they're no longer necessary.
13 years ago
David Schnur 6d70144d5e Moved setupPie into the draw function.
This code is only used to prepare the plot for drawing; inlining it is
cleaner and will allow us to get rid of some plugin-global variables
that existed only to give setupPie a way to share data with the draw
function.
13 years ago
David Schnur cfc07ff285 Eliminate the plugin-global redraw flag.
The redraw flag starts out as true, then is immediately set to false on
draw.  If labels are enabled, drawPie calls drawLabels, which calls
drawLabel for each label.  Any label that can't fit sets redraw back to
true, so the whole process can repeat.

This isn't the most obvious mechanism, and forces one to remember to do
things like setting redraw back to true after drawing, so the plot can
redraw itself on resize or when setting new data.

Instead we now have drawPie return true when it drew successfully, and
false otherwise, which the same happening in drawLabels and drawLabel.
Instead of checking the flag, we now just check the return value.

This has the added benefit of slightly improving performance in the case
where several redraws are necessary, since it now short-circuits out of
the draw loop as soon as one label fails to fit.
13 years ago
David Schnur fa463311dc Make redrawAttempts and shrink proper constants. 13 years ago
David Schnur 778894324d Make the slice total a local variable.
The total is only used within the combine function; it doesn't need to
exist at the top level of the plugin.
13 years ago
David Schnur a1c84203bd Moved fixData and calcData into combine.
They're small and not used anywhere else, so keeping them in separate
functions only serves to increase complexity.
13 years ago
David Schnur a03c4c199d Moved other hooks out of the processOptions hook.
In plugins we should never add hooks conditionally; the condition should
remain within individual hooks, so the plugin can be toggled at any
time.

Ideally we should also 'inline' the hook functions, since they're used
nowhere else.  But since that would involve a lot of code changes, we'll
put it off until the broader cleanup effort scheduled for 0.9.0.
13 years ago
David Schnur f294bf19a3 Cleaned up processOptions and bindEvents hooks. 13 years ago
David Schnur aaf41ea411 Fix placeholders for examples with other content.
After shrinking the global example placeholder size, ones with
additional content within the demo area needed to be tweaked
individually, to prevent the other content from wrapping down or
extending off the side of the container.
13 years ago
David Schnur b475c7219e Slightly reduce placeholder and header sizes.
The smaller size ensures that the example plots remain fully visible on
more of our most common visitor screen resolutions.
13 years ago
David Schnur bcce4a48b5 Load the first AJAX series by default.
We don't want users to think the example is broken when they first load
it.
13 years ago
David Schnur 840937cf33 Updated path to the timezone example.
The location of the file changed during the recent example revamp.
13 years ago
David Schnur a2cbc3a6be Load timezones asynchronously.
This prevents the Chicago example from showing up blank.  The
alternative is to define a callback, but that's messier.
13 years ago
David Schnur 23005fdd4e Move placeholder styles into .demo-placeholder.
This allows a page to have multiple placeholders, since we're no longer
tied to unique IDs.
13 years ago
David Schnur 98b6361aa9 Preserve canvas elements on re-plot.
Since the Canvas .text object is jQuery-wrapped, it was not preserved as
expected when clearing the canvas of junk.  I've replaced the selection
with one based on element classes.
13 years ago
David Schnur d2642e80cf Fixed missing/superfluous semicolons. 13 years ago
David Schnur c36b344677 Replace axis.font with options.font.
Instead of giving the axis its own font property, we simply look at its
options, where the font comes from in the first place.  A separate
property is unnecessary and inconsistent with the way other axis options
are handled.
13 years ago
David Schnur ec168da2cb Merge pull request #942 from sejordan/tickformatter-bug
Fix incorrect display of NaN with the default tickFormatter.
13 years ago
Sean Jordan f6f764eb2d Fixing bug with default tickFormatter
Change-Id: If53fdb1bf9563834c58cf2b569d0e1a6a7155eb8
13 years ago
David Schnur b637d67b9b Merge pull request #940 from dnschnur/better-examples
Revamped the built-in examples.
13 years ago
David Schnur e08ec95749 Updated examples index page styles. 13 years ago
David Schnur 713ba7704a Update example index page links for nesting. 13 years ago
David Schnur a2718dbee6 Add the Flot version to each example's footer. 13 years ago
David Schnur 79c3e25fe6 Allow live resizing in the resize example. 13 years ago
David Schnur ab7eb27c43 Flatten pie button styles so they fit in better. 13 years ago
David Schnur cf9cb4296c Fix the pie interactivity example. 13 years ago
David Schnur 61a13d1059 Additional code & comments cleanup. 13 years ago
David Schnur 492e97eacc Avoid being too specific in placeholder styles. 13 years ago
David Schnur ed791745c7 Re-styled and cleaned up all the examples. 13 years ago
David Schnur 8e8327f5d9 Add a sub-header style for per-plot labels. 13 years ago
David Schnur 0f23d23118 Pad check boxes to match the new page font size. 13 years ago
David Schnur 2eccabcf8c Generalize placeholder styles.
Give any direct child of demo-containre the same style, so it can be
used for both #placeholder and #overview.
13 years ago