NYTimes.BestsellerHistory

CLR Class to get the ranking history of books in the New York Times Bestseller list. For more details see the API documentation

Properties

  • IsLoading Gets a value indicating whether the history results are loading
  • ApiKey Get or sets the Bestsellers API Key
  • AgeGroup Gets or sets the age group to query. Use the AgeGroupList for possible values.
  • AgeGroupList Gets the list of age groups for the AgeGroup property
  • Author Gets or sets the author
  • Contributor Gets or sets the contributor
  • ISBN Gets or sets the 10 or 13-digit ISBN
  • Price Gets or sets the publisher's list price of the book
  • Publisher Gets or sets the standardized name of the publisher
  • Title Gets or sets the title of the book to search for. Partial names work as well.
  • Sort Gets or sets the sort order (AgeGroup | Author | Contributor | ISBN | Price | Publisher | Title)
  • Results Gets the book history results as a collection of NYTimes.Data.Book objects
  • Result Gets a single book history when searching for a single book as at NYTimes.Data.Book object.

Example

BestSellers History Demo

<UserControl x:Class="BestsellerHistory.Page"
    xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    d:DesignWidth="400" d:DesignHeight="300" 
    xmlns:nyt="clr-namespace:NYTimes;assembly=NYTimesSilverlightKit" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    xmlns:nytvc="clr-namespace:NYTimes.ValueConverters;assembly=NYTimesSilverlightKit">
	<UserControl.Resources>
		<nyt:BestsellerHistory x:Key="BestsellerHistoryDS" Title="Outliers" 
                               d:IsDataSource="True" />
        <nytvc:InverterConverter x:Key="InverterConverter"/>
	</UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition/>
    	</Grid.RowDefinitions>
        <chartingToolkit:Chart Grid.Row="1">
            <chartingToolkit:LineSeries
        ItemsSource="{Binding Mode=OneWay, Path=RankHistory, Source={StaticResource BestsellerHistoryDS}}"
        DependentValueBinding="{Binding Rank, Converter={StaticResource InverterConverter}}"
        IndependentValuePath="BestsellersDate"
        Title="Rank">
                <chartingToolkit:LineSeries.DataPointStyle>
                    <Style TargetType="chartingToolkit:LineDataPoint">
                        <Setter Property="DependentValueStringFormat" Value="{}{0:0.#;0.#}"/>
                    </Style>
                </chartingToolkit:LineSeries.DataPointStyle>
                <chartingToolkit:LineSeries.DependentRangeAxis>
                    <chartingToolkit:LinearAxis
                Orientation="Y"
                Minimum="-20"
                Maximum="-1"
                Interval="1"
                ShowGridLines="False">
                        <chartingToolkit:LinearAxis.AxisLabelStyle>
                            <Style TargetType="chartingToolkit:AxisLabel">
                                <Setter Property="StringFormat" Value="{}{0:0.#;0.#}"/>
                            </Style>
                        </chartingToolkit:LinearAxis.AxisLabelStyle>
                    </chartingToolkit:LinearAxis>
                </chartingToolkit:LineSeries.DependentRangeAxis>
            </chartingToolkit:LineSeries>
        </chartingToolkit:Chart>
    	<StackPanel Orientation="Horizontal" Margin="4">
    		<TextBlock Height="Auto" Text="Title" Width="Auto" VerticalAlignment="Center"/>
    		<TextBox Text="{Binding Mode=TwoWay, Path=Title, Source={StaticResource BestsellerHistoryDS}}" 
                     Margin="5,0,0,0" Width="207"/>
    		<Button Content="Search Bestseller History"/>
    	</StackPanel>
    </Grid>
</UserControl>

Last edited May 14, 2009 at 4:22 AM by mscherotter, version 3

Comments

No comments yet.